diff options
author | pixel <pixel> | 2007-05-30 17:59:50 +0000 |
---|---|---|
committer | pixel <pixel> | 2007-05-30 17:59:50 +0000 |
commit | 466d10f7f0e389924bc0d19dc67ad0730e58d721 (patch) | |
tree | b171879c79099338bdb9dc1e37550e1b81050a87 /lib | |
parent | 21b13d53e892e0c147659ede4e69e47a30cd5079 (diff) |
Fixing slightly attribute system.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/xmllib.lua | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/lib/xmllib.lua b/lib/xmllib.lua index b6687fb..4bdf977 100644 --- a/lib/xmllib.lua +++ b/lib/xmllib.lua @@ -19,7 +19,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* $Id: xmllib.lua,v 1.7 2007-05-30 11:57:10 pixel Exp $ */ +/* $Id: xmllib.lua,v 1.8 2007-05-30 17:59:50 pixel Exp $ */ ]]-- @@ -146,20 +146,18 @@ local function render_attrs(t) if type(t) ~= "table" then return "" end for k, v in pairs(t) do - r = r .. " " .. k .. '="' .. v .. '"' + if v ~= "" then + r = r .. " " .. k .. '="' .. v .. '"' + else + r = r .. " " .. k + end end return r end local function space_indent(depth) - local r, i = "" - - for i = 1, depth do - r = r .. " " - end - - return r + return string.rep(" ", 4 * depth) end local function do_render_r(v, depth) |