From ebd4ea2bb3743aa6ee8442fec4bac465e0127c87 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Mon, 29 Nov 2021 02:13:45 +0100 Subject: util.stanza: Adjust pretty printing for symmetry Self-closing and had some asymmetries in applied colors. --- util/stanza.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/stanza.lua b/util/stanza.lua index d03558ce..a6bc51c4 100644 --- a/util/stanza.lua +++ b/util/stanza.lua @@ -526,7 +526,7 @@ if do_pretty_printing then -- Outer gsub call takes each , 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) .. -- cgit v1.2.3