Software /
code /
prosody
Changeset
11960:12a3c05aa12d
util.stanza: Adjust pretty printing for symmetry
Self-closing <tags/> and <?processing instructions?> had some
asymmetries in applied colors.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Mon, 29 Nov 2021 02:13:45 +0100 |
parents | 11959:814b750aa2d0 |
children | 11961:542a9a503073 |
files | util/stanza.lua |
diffstat | 1 files changed, 1 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- 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) ..