1
0

wikilinks: cleanup

This commit is contained in:
Simon Michael
2023-11-30 14:18:45 -10:00
parent 9fa64afd2d
commit 765ee49157

View File

@@ -9,9 +9,9 @@
-- - these do not find files across folders - correct path is required
-- - these are not aware of file existence - targets should exist
function Link(elem)
if elem.title == "wikilink" then
t = elem.target .. "#"
function Link(el)
if el.title == "wikilink" then
t = el.target .. "#"
t = t:gsub(" ", "-")
-- t = t:gsub(t, "'", "")
path, frag = t:match("([^#]*)#([^#]*)")
@@ -27,7 +27,7 @@ function Link(elem)
frag = pandoc.text.lower(frag)
t = t .. "#" .. frag
end
elem.target = t
el.target = t
end
return elem
return el
end