summaryrefslogtreecommitdiffstats
path: root/filters
diff options
context:
space:
mode:
Diffstat (limited to 'filters')
-rw-r--r--filters/common_actions.lua16
1 files changed, 7 insertions, 9 deletions
diff --git a/filters/common_actions.lua b/filters/common_actions.lua
index 6070c7e..535a225 100644
--- a/filters/common_actions.lua
+++ b/filters/common_actions.lua
@@ -1,7 +1,5 @@
1function CodeBlock(el) 1function CodeBlock(el)
2 if next(el.classes) == nil then 2 if el.classes[1] == "plain" then
3 el.classes = el.classes .. {'c-page__pre'}
4 elseif el.classes[1] == "plain" then
5 el = pandoc.Div({el}, {class = 's-code'}) 3 el = pandoc.Div({el}, {class = 's-code'})
6 else 4 else
7 local formatted = pandoc.pipe('pygmentize', { 5 local formatted = pandoc.pipe('pygmentize', {
@@ -15,12 +13,12 @@ function CodeBlock(el)
15end 13end
16 14
17function Header(el) 15function Header(el)
18 if el.level == 1 then 16 if el.level == 1 or el.level == 2 then
19 el.classes = el.classes .. {'c-page__h1'} 17 local newchildren = pandoc.List()
20 elseif el.level == 2 then 18
21 el.classes = el.classes .. {'c-page__h2'} 19 newchildren:insert(pandoc.Span(el.content, {class = 's-body__title-inner'}))
22 elseif el.level == 3 then 20
23 el.classes = el.classes .. {'c-page__h3'} 21 el.content = newchildren
24 end 22 end
25 return el 23 return el
26end 24end