util/stanza.lua
changeset 11646 7f2dee4249aa
parent 11644 51598e46e136
child 11790 39164ea2ab9e
--- a/util/stanza.lua	Tue Jun 29 16:05:35 2021 +0200
+++ b/util/stanza.lua	Tue Jun 29 16:06:54 2021 +0200
@@ -488,6 +488,7 @@
 	return new_stanza("presence", attr);
 end
 
+local pretty;
 if do_pretty_printing then
 	local getstyle, getstring = termcolours.getstyle, termcolours.getstring;
 
@@ -512,7 +513,7 @@
 		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 @@
 	error_reply = error_reply;
 	presence = presence;
 	xml_escape = xml_escape;
+	pretty_print = pretty;
 };