Line punches deleted by pandoc

I use pandoc to translate from html to markdown.
Pandoc removes the row in the results.

Here is the command I'm using:

pandoc -f html -t markdown_phpextra myfile.html 

Is there a way to save all lines in an html file?

+4
source share
4 answers

Newer versions of pandoc support --wrap=preserve .

Old answer:

Pandoc does not distinguish between newlines and other spaces (outside of the <pre> tags), since they do not differ semantically in HTML.

0
source

I dig an old question, since I just discovered that you can specify the Pandoc extension for this:

 pandoc -f markdown+hard_line_breaks -t html myfile.html 

This worked for me (note that I used a regular markdown). See Also the pandoc man page for further explanations.

+5
source

Use <pre> tags wherever spaces are needed. Have you tried   or <br>

0
source

I had the same problem. What I did to replace each line of a new line with the line <p></p> with additional <p> and </p> at the beginning and at the end. Then I passed the text to pandoc. He worked well.

0
source

All Articles