adbb81edbcdfde3cde3c27f9756a6e18fd3abdb1 lrnassar Mon Mar 9 09:27:41 2026 -0700 Small fixes to the lua rules that were messing up the column spacing for markdown tables, and a double escaping when links were placed inside tables, refs #36894 diff --git docs/staticPage.lua docs/staticPage.lua index 5aa4cada964..b02a1eb7de8 100644 --- docs/staticPage.lua +++ docs/staticPage.lua @@ -207,31 +207,30 @@ table.insert(refs, ref) end return table.concat(refs, "") end function Link(s, src, tit, attr) if string.sub(src, 1, 7)=="mailto:" then src = "mailto:" .. obfuscate(string.sub(src, 7), 7) -- assume that the link label is an email address if it contains an @ character if string.match(s, "%@")~=nil then s = obfuscate(s) end else src = escape(src, true) tit = escape(tit, true) - s = escape(s, true) end return "<a href='" .. src .. "' title='" .. tit .. "'>" .. s .. "</a>" end function Image(s, src, tit, attr) return "<img src='" .. escape(src,true) .. "' title='" .. escape(tit,true) .. "'/>" end function Code(s, attr) return "<code" .. attributes(attr) .. ">" .. escape(s) .. "</code>" @@ -378,31 +377,31 @@ -- Caption is a string, aligns is an array of strings, -- widths is an array of floats, headers is an array of -- strings, rows is an array of arrays of strings. function Table(caption, aligns, widths, headers, rows) local buffer = {} local function add(s) table.insert(buffer, s) end add("<table>") if caption ~= "" then add("<caption>" .. caption .. "</caption>") end if widths and widths[1] ~= 0 then for _, w in pairs(widths) do - add('<col width="' .. string.format("%d%%", w * 100) .. '" />') + add('<col width="' .. string.format("%.0f%%", w * 100) .. '" />') end end local header_row = {} local empty_header = true for i, h in pairs(headers) do local align = html_align(aligns[i]) table.insert(header_row,'<th align="' .. align .. '">' .. h .. '</th>') empty_header = empty_header and h == "" end if empty_header then head = "" else add('<tr class="header">') for _,h in pairs(header_row) do add(h)