util.stanza: Adjust pretty printing for symmetry
authorKim Alvefur <zash@zash.se>
Mon, 29 Nov 2021 02:13:45 +0100
changeset 11964 12a3c05aa12d
parent 11963 814b750aa2d0
child 11965 542a9a503073
util.stanza: Adjust pretty printing for symmetry Self-closing <tags/> and <?processing instructions?> had some asymmetries in applied colors.
util/stanza.lua
--- a/util/stanza.lua	Sun Nov 28 23:14:31 2021 +0100
+++ b/util/stanza.lua	Mon Nov 29 02:13:45 2021 +0100
@@ -526,7 +526,7 @@
 		-- Outer gsub call takes each <tag>, applies colour to the brackets, the
 		-- tag name, then applies one inner gsub call to colour the attributes and
 		-- another for any text content.
-		return (s:gsub("(</?)([^ >]*)(.-)([?/]?>)([^<]*)", function(opening_bracket, tag_name, attrs, closing_bracket, content)
+		return (s:gsub("(<[?/]?)([^ >/?]*)(.-)([?/]?>)([^<]*)", function(opening_bracket, tag_name, attrs, closing_bracket, content)
 			return getstring(blue1, opening_bracket)..getstring(blue2, tag_name)..
 				attrs:gsub("([^=]+)(=)([\"'])(.-)([\"'])", attr_replace) ..
 			getstring(blue1, closing_bracket) ..