# HG changeset patch # User Kim Alvefur # Date 1638148425 -3600 # Node ID 12a3c05aa12dff501b34ed4ea26ff60a0b703f83 # Parent 814b750aa2d08ae9810e09c54d329ed52eb2f8eb util.stanza: Adjust pretty printing for symmetry Self-closing and had some asymmetries in applied colors. diff -r 814b750aa2d0 -r 12a3c05aa12d 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 , 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) ..