diff options
Diffstat (limited to 'filters')
| -rw-r--r-- | filters/common_actions.lua | 16 |
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 @@ | |||
| 1 | function CodeBlock(el) | 1 | function 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) | |||
| 15 | end | 13 | end |
| 16 | 14 | ||
| 17 | function Header(el) | 15 | function 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 |
| 26 | end | 24 | end |
