From 466d10f7f0e389924bc0d19dc67ad0730e58d721 Mon Sep 17 00:00:00 2001 From: pixel Date: Wed, 30 May 2007 17:59:50 +0000 Subject: Fixing slightly attribute system. --- lib/xmllib.lua | 16 +++++++--------- 1 file 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) -- cgit v1.2.3