Software /
code /
prosody
Changeset
11426:c7948491c5e4
util.rsm: Improve readability using compacter stanza building API
At least I think :text_tag improves readability.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sat, 06 Mar 2021 15:24:45 +0100 |
parents | 11425:fc7706fe115d |
children | 11427:83f5499d1f10 |
files | util/rsm.lua |
diffstat | 1 files changed, 5 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/util/rsm.lua Fri Mar 05 15:05:21 2021 +0100 +++ b/util/rsm.lua Sat Mar 06 15:24:45 2021 +0100 @@ -52,26 +52,26 @@ if type(data) == "table" then st:tag("first", { index = inttostr(data.index) }):text(data[1]):up(); else - st:tag("first"):text(data):up(); + st:text_tag("first", data); end end; before = function(st, data) if data == true then st:tag("before"):up(); else - st:tag("before"):text(data):up(); + st:text_tag("before", data); end end; max = function (st, data) - st:tag("max"):text(inttostr(data)):up(); + st:text_tag("max", inttostr(data)); end; count = function (st, data) - st:tag("count"):text(inttostr(data)):up(); + st:text_tag("count", inttostr(data)); end; }, { __index = function(_, name) return function(st, data) - st:tag(name):text(data):up(); + st:text_tag(name, data); end end; });