sanitize html of list elements

This commit is contained in:
sejo 2022-04-22 14:11:18 -05:00
parent 66c71b0ecd
commit cbc08122f4
1 changed files with 4 additions and 1 deletions

View File

@ -207,8 +207,9 @@ function firstPass()
elseif string.match( line, "^%*") then -- LIST ITEMS
-- TODO reuse {wikilinks} code from paragraphs
-- TODO apply the sanitization to everything?
-- web
local strippedline = string.sub(line, 3) -- remove "* "
local strippedline = sanitize(string.sub(line, 3)) -- remove "* "
local webtext = string.gsub( strippedline, "{(.-)}", function (wikiname)
return string.format("<a href='./%s.html'>%s</a>", pages[wikiname].slug, wikiname)
end)
@ -269,6 +270,8 @@ function firstPass()
local webline = string.gsub( line, "{(.-)}", function (wikiname)
return string.format("<a href='./%s.html'>%s</a>", pages[wikiname].slug, wikiname)
end)
if not flags.p then
out.web = string.format("<p>%s", webline)
flags.p = true