filter cleanups
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
-- Make all headings (except the page h1 added by page.tmpl)
|
-- Make all headings (except the h1 added by page.tmpl)
|
||||||
-- clickable links to themselves, for easy bookmarking/linking.
|
-- clickable links to themselves, for easy bookmarking/linking.
|
||||||
|
-- site.css controls their style.
|
||||||
|
|
||||||
function Header(el)
|
function Header(el)
|
||||||
el.content = pandoc.Link(el.content, '#' .. el.identifier)
|
el.content = pandoc.Link(el.content, '#' .. el.identifier)
|
||||||
|
|||||||
@@ -16,14 +16,15 @@ function Link(el)
|
|||||||
-- t = t:gsub(t, "'", "")
|
-- t = t:gsub(t, "'", "")
|
||||||
path, frag = t:match("([^#]*)#([^#]*)")
|
path, frag = t:match("([^#]*)#([^#]*)")
|
||||||
t = path
|
t = path
|
||||||
if path:len() > 0 and not (
|
if not (
|
||||||
|
path:len() == 0 or
|
||||||
path:match('%.html$') or
|
path:match('%.html$') or
|
||||||
path:match('%.%.$') or
|
path:match('%.%.$') or
|
||||||
path:match('/$')
|
path:match('/$')
|
||||||
) then
|
) then
|
||||||
t = t .. ".html"
|
t = t .. ".html"
|
||||||
end
|
end
|
||||||
if string.len(frag) > 0 then
|
if frag:len() > 0 then
|
||||||
frag = pandoc.text.lower(frag)
|
frag = pandoc.text.lower(frag)
|
||||||
t = t .. "#" .. frag
|
t = t .. "#" .. frag
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user