diff options
author | Kim Alvefur <zash@zash.se> | 2021-11-29 02:13:45 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2021-11-29 02:13:45 +0100 |
commit | ebd4ea2bb3743aa6ee8442fec4bac465e0127c87 (patch) | |
tree | 6132bd3eaad35edde04fcb4b23c436c9c637581b /util | |
parent | eb2c2d45970bf7c00cfb225618774dceb15668c3 (diff) | |
download | prosody-ebd4ea2bb3743aa6ee8442fec4bac465e0127c87.tar.gz prosody-ebd4ea2bb3743aa6ee8442fec4bac465e0127c87.zip |
util.stanza: Adjust pretty printing for symmetry
Self-closing <tags/> and <?processing instructions?> had some
asymmetries in applied colors.
Diffstat (limited to 'util')
-rw-r--r-- | util/stanza.lua | 2 |
1 files changed, 1 insertions, 1 deletions
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 <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) .. |