summaryrefslogtreecommitdiff
path: root/lib/xmllib.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lib/xmllib.lua')
-rw-r--r--lib/xmllib.lua16
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)