Skip to content

Lua filter to wrap each paragraph in a custom-style "Paragraph" div, and apply "New paragraph" div for paragraphs after a blockquote or a heading or title (beginning) for Word template export #10124

Answered by alerque
ElDuderino321 asked this question in Q&A
Discussion options

You must be logged in to vote

Use the Blocks filter and iterate over the top level blocks yourself instead of letting Pandoc throw Para blocks to your filter willy-nilly. Change them to what you want them to be in place, something like this:

local function Blocks (blocks)
   for i, block in ipairs(blocks) do
      if block.t == "Para" then
         blocks[i] = pandoc.Div(block.content, {...})
      end
   end
   return blocks
end

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@ElDuderino321
Comment options

@alerque
Comment options

@ElDuderino321
Comment options

@ElDuderino321
Comment options

Answer selected by ElDuderino321
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants