Changeset

133:be3b857e991f

clix.raw: Use indentation when prettyprinting if available in util.stanza Properly indented XML is a lot more readable than squished together on a single line.
author Kim Alvefur <zash@zash.se>
date Sat, 14 Nov 2020 15:33:35 +0100
parents 132:3addfb97296c
children 134:d1fa853325b9
files clix/raw.lua
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/clix/raw.lua	Sat Nov 14 15:30:35 2020 +0100
+++ b/clix/raw.lua	Sat Nov 14 15:33:35 2020 +0100
@@ -18,6 +18,9 @@
 			if stanza.attr.to == conn.jid then
 				stanza.attr.to = nil;
 			end
+			if opts.pretty and stanza.indent then
+				return print(stanza:indent(1, "  "):pretty_print());
+			end
 			return print(stanza);
 		end
 		conn:hook("stanza", stprint)