summaryrefslogtreecommitdiff
path: root/filters/anchored-h.lua
diff options
context:
space:
mode:
Diffstat (limited to 'filters/anchored-h.lua')
-rw-r--r--filters/anchored-h.lua11
1 files changed, 11 insertions, 0 deletions
diff --git a/filters/anchored-h.lua b/filters/anchored-h.lua
new file mode 100644
index 0000000..f5cb125
--- /dev/null
+++ b/filters/anchored-h.lua
@@ -0,0 +1,11 @@
+pandoc.utils = require 'pandoc.utils'
+if FORMAT:match 'html' then
+ function Header(el)
+ local l = pandoc.Link("ΒΆ", "#"..el.identifier)
+ l.classes[1]="anchor"
+ el.content[#el.content+1] = pandoc.Space()
+ el.content[#el.content+1] = l
+ return el
+ end
+end
+