2016-08-12 42 views
1

如何使用Sphinx/rst成功安全部分标记段落?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. 

回答

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