From f40173b4c7d7e31d0264964de0999559c4f4e28f Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Tue, 29 Jun 2021 16:06:54 +0200 Subject: util.stanza: Export pretty printing function --- util/stanza.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'util/stanza.lua') 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 , 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; }; -- cgit v1.2.3