summaryrefslogtreecommitdiff
path: root/filters
diff options
context:
space:
mode:
authorEkaitz Zarraga <ekaitz@elenq.tech>2020-05-27 00:15:18 +0200
committerEkaitz Zarraga <ekaitz@elenq.tech>2020-05-27 00:15:55 +0200
commit35a01b7547ecc30a031c110d85c337a8466214f2 (patch)
treee0bb7d64752f290e7c363dc28cbecc1cbbc64361 /filters
parent0a5445dee23e9e1efe7962e0b7d815332f39b7d3 (diff)
add anchor filter for html
Diffstat (limited to 'filters')
-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
+