From f561409f1cf476e2cc1112538eb7b724748a2378 Mon Sep 17 00:00:00 2001 From: Volpeon Date: Thu, 29 Apr 2021 20:31:16 +0200 Subject: Update --- filters/common_actions.lua | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'filters/common_actions.lua') 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 @@ function CodeBlock(el) - if next(el.classes) == nil then - el.classes = el.classes .. {'c-page__pre'} - elseif el.classes[1] == "plain" then + if el.classes[1] == "plain" then el = pandoc.Div({el}, {class = 's-code'}) else local formatted = pandoc.pipe('pygmentize', { @@ -15,12 +13,12 @@ function CodeBlock(el) end function Header(el) - if el.level == 1 then - el.classes = el.classes .. {'c-page__h1'} - elseif el.level == 2 then - el.classes = el.classes .. {'c-page__h2'} - elseif el.level == 3 then - el.classes = el.classes .. {'c-page__h3'} + if el.level == 1 or el.level == 2 then + local newchildren = pandoc.List() + + newchildren:insert(pandoc.Span(el.content, {class = 's-body__title-inner'})) + + el.content = newchildren end return el end -- cgit v1.2.3-70-g09d2