【问题标题】:How to get inline code ending with spaces with docutils/sphinx?如何使用 docutils/sphinx 获取以空格结尾的内联代码?
【发布时间】:2020-08-10 10:18:06
【问题描述】:

以下 rST 指令不支持尾随空格:

:code:`foo    `

例子:

>>> from docutils import core
>>> whole = core.publish_parts(""":code:`x    `""")['whole']
<string>:1: (WARNING/2) Inline interpreted text or phrase reference start-string without end-string.

有没有办法消除这个警告?

【问题讨论】:

    标签: python-sphinx restructuredtext docutils


    【解决方案1】:

    没有。根据docutils documentation of Inline markup recognition rules

    1. 内联标记结束字符串的前面必须紧跟非空格。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-02-15
      • 2014-03-02
      • 2021-08-01
      • 1970-01-01
      • 1970-01-01
      • 2011-12-26
      • 1970-01-01
      • 2017-03-28
      相关资源
      最近更新 更多