diff options
-rw-r--r-- | teal-src/util/stanza.d.tl | 1 | ||||
-rw-r--r-- | util/stanza.lua | 4 |
2 files changed, 4 insertions, 1 deletions
diff --git a/teal-src/util/stanza.d.tl b/teal-src/util/stanza.d.tl index b96f9ff3..a358248a 100644 --- a/teal-src/util/stanza.d.tl +++ b/teal-src/util/stanza.d.tl @@ -56,6 +56,7 @@ local record lib error_reply : function ( stanza_t, string, string, string, string ) presence : function ( { string : string } ) : stanza_t xml_escape : function ( string ) : string + pretty_print : function ( string ) : string end return lib diff --git a/util/stanza.lua b/util/stanza.lua index 86ec458b..7f321da8 100644 --- a/util/stanza.lua +++ b/util/stanza.lua @@ -488,6 +488,7 @@ local function presence(attr) return new_stanza("presence", attr); end +local pretty; if do_pretty_printing then local getstyle, getstring = termcolours.getstyle, termcolours.getstring; @@ -512,7 +513,7 @@ if do_pretty_printing then getstring(green1, "%3") -- ; ); - local function pretty(s) + function pretty(s) -- Tag soup color -- 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 @@ -581,4 +582,5 @@ return { error_reply = error_reply; presence = presence; xml_escape = xml_escape; + pretty_print = pretty; }; |