1

如何使用 Sphinx/rst 成功地安全部分标记段落?

(U) This is a portion marked heading
------------------------------------

(U) This is a portion marked sentence that renders not what I'd expect.

(U) This too is portion marked, and renders unexpectedly.

(U) This too is portion marked, but it does render fine when another sentence is placed directly below.
Next sentence.

渲染时(见下文),标题看起来不错,但句子看起来像一个列表。(由于对使用和)字符的部分标记信息的严格要求,使用替换/替换指令不是可接受的解决方案。

渲染输出:

(U) This is a portion marked heading

  U. This is a portion marked sentence that renders not what I'd expect.

  U. This too is portion marked, and renders unexpectedly.

(U) This too is portion marked, but it does render fine when another sentence is placed directly below. Next sentence.
4

1 回答 1

0

这单行,

(U) This is a portion marked sentence

被解释为枚举列表中的一项,其中(U)是用括号括起来的枚举数。

请参阅http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#enumerated-lists。这里说:

如果单行段落以与枚举数相同的文本开头(“A.”、“1.”、“(b)”、“I)”等),则必须对第一个字符进行转义以便将该行解析为普通段落:

所以前面的反斜杠(U)会使该行显示为普通段落:

\(U) This is a portion marked sentence
于 2016-08-13T09:14:39.020 回答