From 6d29e83effd717a1938859df15ab6f03801d363a Mon Sep 17 00:00:00 2001 From: ubq323 Date: Wed, 6 Nov 2024 00:07:16 +0000 Subject: remove newlines :( --- html.lua | 12 ++---------- 1 file 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"):format(tag.tname,attrs,maybenl,html(tag.body),tag.tname) + return ("<%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 -- cgit v1.2.3