Forethinker
Forethinker

Reputation: 3758

Using pandoc to convert html to rst strips the newlines from the pre block

For example, when I conver the following page: https://developers.google.com/edu/python/strings

s = 'hi'
print s[1]          ## i
print len(s)        ## 2
print s + ' there'  ## hi there

becomes

.. code:: prettyprint

      s = 'hi'  print s[1]          ## i  print len(s)        ## 2  print s + ' there'  ## hi there

This is because there is a tag on the pre block: <pre class=prettyprint> How can I make pandoc to print out the codeblock with proper space? --no-highlight didn't do anything it seems.

Upvotes: 0

Views: 1062

Answers (1)

Matthew Pickering
Matthew Pickering

Reputation: 776

This is because the source code in your link uses <br> tags rather than newline characters. Pandoc should probably interpret <br> tags inside <pre> tags.

I have opened an issue on the pandoc issue tracker here.

Upvotes: 2

Related Questions