【问题标题】:Using pandoc to convert html to rst strips the newlines from the pre block使用 pandoc 将 html 转换为 rst 从 pre 块中删除换行符
【发布时间】:2014-09-10 06:00:27
【问题描述】:

例如,当我转换以下页面时:https://developers.google.com/edu/python/strings

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

变成

.. code:: prettyprint

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

这是因为pre块上有一个标签:<pre class=prettyprint> 如何使 pandoc 打印出具有适当空间的代码块? --no-highlight 似乎没有做任何事情。

【问题讨论】:

    标签: restructuredtext pandoc


    【解决方案1】:

    这是因为链接中的源代码使用<br> 标签而不是换行符。 Pandoc 可能应该在 <pre> 标签内解释 <br> 标签。

    我在 pandoc 问题跟踪器 here 上打开了一个问题。

    【讨论】:

      猜你喜欢
      • 2015-07-08
      • 2015-12-07
      • 2019-02-25
      • 1970-01-01
      • 2013-04-13
      • 2013-04-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多