summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--html.lua12
1 files changed, 2 insertions, 10 deletions
diff --git a/html.lua b/html.lua
index e265578..532d606 100644
--- a/html.lua
+++ b/html.lua
@@ -19,14 +19,10 @@ local html
local function fmt_tag(tag)
local attrs = tag.attrs and fmt_attrs(tag.attrs) or ""
local selfclosing = (tag.body == "")
- local sameline = type(tag.body) == "string"
- or (type(tag.body) == "table" and tag.body.tag)
- or (type(tag.body) == "table" and #tag.body <= 1)
- local maybenl = sameline and "" or "\n"
if selfclosing then
return ("<%s%s/>"):format(tag.tname,attrs)
else
- return ("<%s%s>%s%s</%s>"):format(tag.tname,attrs,maybenl,html(tag.body),tag.tname)
+ return ("<%s%s>%s</%s>"):format(tag.tname,attrs,html(tag.body),tag.tname)
end
end
@@ -72,13 +68,9 @@ html = function (x)
return safe( tostring(x) )
else
-- just a regular list
- local nl = "\n"
- if #x <= 2 then
- nl = ""
- end
local o = ""
for _,item in ipairs(x) do
- o = o .. tostring(html(item)) .. nl
+ o = o .. tostring(html(item))
end
return safe(o)
end