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