1
0

filter cleanups

This commit is contained in:
Simon Michael
2023-11-30 15:22:48 -10:00
parent 42651ab844
commit eb8b829492
2 changed files with 5 additions and 3 deletions

View File

@@ -16,14 +16,15 @@ function Link(el)
-- t = t:gsub(t, "'", "")
path, frag = t:match("([^#]*)#([^#]*)")
t = path
if path:len() > 0 and not (
if not (
path:len() == 0 or
path:match('%.html$') or
path:match('%.%.$') or
path:match('/$')
) then
t = t .. ".html"
end
if string.len(frag) > 0 then
if frag:len() > 0 then
frag = pandoc.text.lower(frag)
t = t .. "#" .. frag
end