Search code examples
htmlmarkdownline-breakspandoc

Linebreaks removed by pandoc


I am using pandoc to translate from html to markdown.
Pandoc is removing linebreak in the results.

Here is the command I am using:

pandoc -f html -t markdown_phpextra myfile.html

Is there any way for keeping all the linebreaks in the html file ?


Solution

  • Newer pandoc versions support --wrap=preserve.

    Old answer:

    Pandoc does not distinguish between newlines and other whitespace (outside of <pre> tags), since these are not semantically different in HTML.