Software /
code /
prosody
Diff
util/stanza.lua @ 23:236375777f8c
Some docs written by Thorns. Need reviewing.
author | bt@silverblade |
---|---|
date | Wed, 17 Sep 2008 22:20:08 +0300 |
parent | 6:7ad47ce20394 |
child | 30:bcf539295f2d |
line wrap: on
line diff
--- a/util/stanza.lua Wed Aug 27 03:16:14 2008 +0100 +++ b/util/stanza.lua Wed Sep 17 22:20:08 2008 +0300 @@ -1,6 +1,6 @@ local t_insert = table.insert; local t_remove = table.remove; -local format = string.format; +local s_format = string.format; local tostring = tostring; local setmetatable = setmetatable; local pairs = pairs; @@ -97,10 +97,10 @@ local attr_string = ""; if t.attr then - for k, v in pairs(t.attr) do if type(k) == "string" then attr_string = attr_string .. format(" %s='%s'", k, tostring(v)); end end + for k, v in pairs(t.attr) do if type(k) == "string" then attr_string = attr_string .. s_format(" %s='%s'", k, tostring(v)); end end end - return format("<%s%s>%s</%s>", t.name, attr_string, children_text, t.name); + return s_format("<%s%s>%s</%s>", t.name, attr_string, children_text, t.name); end function stanza_mt.__add(s1, s2)