diff --git a/autotests/folding/test.pbl.fold b/autotests/folding/test.pbl.fold
new file mode 100644
--- /dev/null
+++ b/autotests/folding/test.pbl.fold
@@ -0,0 +1,58 @@
+# Wesnoth Markup Language
+
+#textdomain wesnoth-libs
+
+#define __GUI_WINDOW_HEIGHT
+(
+ if(window_height = 0, 9999, window_height)
+)#enddef
+
+#define __GUI_WINDOW_FUNCTIONS
+def reevaluate_best_size(w, s)
+(
+[
+ 0,
+#
+ debug_print('window ', w),
+ debug_print('screen ', s)
+#
+][0]
+);
+#enddef
+
+[about]
+ title= _ "Campaign Designer"
+ text="Your Name"
+[/about]
+
+[window]
+ id = "tooltip"
+
+ [resolution]
+ definition = "tooltip"
+ automatic_placement = false
+ functions = "{__GUI_WINDOW_FUNCTIONS}"
+
+ [grid]
+
+ [row]
+
+ [column]
+
+ [label]
+ id = "label"
+ definition = "default_small"
+
+ use_markup = true
+ wrap = true
+ [/label]
+
+ [/column]
+
+ [/row]
+
+ [/grid]
+
+ [/resolution]
+
+[/window]
diff --git a/autotests/html/test.pbl.html b/autotests/html/test.pbl.html
new file mode 100644
--- /dev/null
+++ b/autotests/html/test.pbl.html
@@ -0,0 +1,65 @@
+
+
+
+test.pbl
+
+
+# Wesnoth Markup Language
+
+#textdomain wesnoth-libs
+
+#define __GUI_WINDOW_HEIGHT
+(
+ if(window_height = 0, 9999, window_height)
+)#enddef
+
+#define __GUI_WINDOW_FUNCTIONS
+def reevaluate_best_size(w, s)
+(
+[
+ 0,
+#
+ debug_print('window ', w),
+ debug_print('screen ', s)
+#
+][0]
+);
+#enddef
+
+[about]
+ title= _ "Campaign Designer"
+ text="Your Name"
+[/about]
+
+[window]
+ id = "tooltip"
+
+ [resolution]
+ definition = "tooltip"
+ automatic_placement = false
+ functions = "{__GUI_WINDOW_FUNCTIONS}"
+
+ [grid]
+
+ [row]
+
+ [column]
+
+ [label]
+ id = "label"
+ definition = "default_small"
+
+ use_markup = true
+ wrap = true
+ [/label]
+
+ [/column]
+
+ [/row]
+
+ [/grid]
+
+ [/resolution]
+
+[/window]
+
diff --git a/autotests/input/test.pbl b/autotests/input/test.pbl
new file mode 100644
--- /dev/null
+++ b/autotests/input/test.pbl
@@ -0,0 +1,58 @@
+# Wesnoth Markup Language
+
+#textdomain wesnoth-libs
+
+#define __GUI_WINDOW_HEIGHT
+(
+ if(window_height = 0, 9999, window_height)
+)#enddef
+
+#define __GUI_WINDOW_FUNCTIONS
+def reevaluate_best_size(w, s)
+(
+[
+ 0,
+#
+ debug_print('window ', w),
+ debug_print('screen ', s)
+#
+][0]
+);
+#enddef
+
+[about]
+ title= _ "Campaign Designer"
+ text="Your Name"
+[/about]
+
+[window]
+ id = "tooltip"
+
+ [resolution]
+ definition = "tooltip"
+ automatic_placement = false
+ functions = "{__GUI_WINDOW_FUNCTIONS}"
+
+ [grid]
+
+ [row]
+
+ [column]
+
+ [label]
+ id = "label"
+ definition = "default_small"
+
+ use_markup = true
+ wrap = true
+ [/label]
+
+ [/column]
+
+ [/row]
+
+ [/grid]
+
+ [/resolution]
+
+[/window]
diff --git a/autotests/reference/test.pbl.ref b/autotests/reference/test.pbl.ref
new file mode 100644
--- /dev/null
+++ b/autotests/reference/test.pbl.ref
@@ -0,0 +1,58 @@
+# Wesnoth Markup Language
+
+#textdomain wesnoth-libs
+
+#define __GUI_WINDOW_HEIGHT
+(
+ if(window_height = 0, 9999, window_height)
+)#enddef
+
+#define __GUI_WINDOW_FUNCTIONS
+def reevaluate_best_size(w, s)
+(
+[
+ 0,
+#
+ debug_print('window ', w),
+ debug_print('screen ', s)
+#
+][0]
+);
+#enddef
+
+[about]
+ title= _ "Campaign Designer"
+ text="Your Name"
+[/about]
+
+[window]
+ id = "tooltip"
+
+ [resolution]
+ definition = "tooltip"
+ automatic_placement = false
+ functions = "{__GUI_WINDOW_FUNCTIONS}"
+
+ [grid]
+
+ [row]
+
+ [column]
+
+ [label]
+ id = "label"
+ definition = "default_small"
+
+ use_markup = true
+ wrap = true
+ [/label]
+
+ [/column]
+
+ [/row]
+
+ [/grid]
+
+ [/resolution]
+
+[/window]
diff --git a/data/syntax/wml.xml b/data/syntax/wml.xml
--- a/data/syntax/wml.xml
+++ b/data/syntax/wml.xml
@@ -5,6 +5,10 @@
Alternatively try the "normal" way: #kate@freenode, kwrite-devel@kde.org
Changelog (0.35 and later):
***************************
+* 0.42.1
+ - 2018-12-31
+ * Fix infinite loop between the "section" & "error" contexts.
+ * Only highlight tags with valid name format.
* 0.42
- 2011-11-15 :
* Added preprocessor directives: #error, #warning
@@ -54,7 +58,7 @@
* Made the new #ifndef directive be recognized (implemented on Wesnoth 1.3.11 and later)
-->
-
@@ -99,8 +103,10 @@
-
-
+
+
+
@@ -152,18 +158,18 @@
-
+
-
+