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 ?
Digging up an old question since I just discovered that you can specify a Pandoc extension for this:
pandoc -f markdown+hard_line_breaks -t html myfile.html
That worked for me (notice that I used regular markdown, though). See also pandoc's man page for further explanations.
Newer pandoc versions support --wrap=preserve
.
Pandoc does not distinguish between newlines and other whitespace (outside of <pre>
tags), since these are not semantically different in HTML.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With