Skip to content

Converting to Markdown while Retaining Empty Paragraphs #10630

Answered by jgm
little-help asked this question in Q&A
Discussion options

You must be logged in to vote

Download as .docx, and use pandoc -f docx+empty_paragraphs -L convert-empty.lua, together with this Lua filter:

-- convert-empty.lua
function Para(el)
  if not el.content[1] then
    return pandoc.HorizontalRule()
  end
end

This will put a horizontal rule everywhere there was an empty paragraph in the original.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by little-help
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants