Python sphinx 斯芬克斯中普通文本中的换行符

Python sphinx 斯芬克斯中普通文本中的换行符,python-sphinx,Python Sphinx,我在.rst文件中有以下文本: Some text. * Heading | The first topic. | Another topic which is very verbose and spans multiple lines ad infinitum. Topic continued...................................... .. |br| raw:: html <br /> 我希望它呈现为: Some text.

我在.rst文件中有以下文本:

Some text.
* Heading
  | The first topic.
  | Another topic which is very verbose and spans multiple lines ad infinitum.
  Topic continued......................................
.. |br| raw:: html

   <br />
我希望它呈现为:

Some text.
* Heading
  The first topic.
  Another topic which is very verbose and spans multiple lines ad infinitum....................
  Topic continued.............
但是,它在Html中呈现如下所示:

Some text.
* Heading| The first topic.| Another topic which is very verbose and spans multiple lines ad infinitum .................... Topic continued
Sphinx文档建议使用
|
符号来表示换行,就像Stackoverflow上的几个帖子一样,但我一直无法让它工作。我想要一个独立于正在使用的Sphinx builder的方法

元素之间的空白行可以工作,但不能提供我想要的视觉效果

我需要做什么?

分两步进行

首先让您的StructuredText使用正确的空格生成一个应用默认视觉样式的可用HTML结构

Some text.

* Heading

  | The first topic.
  | Another topic which is very verbose and spans multiple lines ad infinitum.

  Topic continued......................................

其次,如果将以下内容添加到主.rst文件中,请重写默认样式表以生成本SO帖子中所述的所需视觉效果。

Some text.
* Heading
  | The first topic.
  | Another topic which is very verbose and spans multiple lines ad infinitum.
  Topic continued......................................
.. |br| raw:: html

   <br />

@史蒂夫:我觉得这个解决方案对我来说太重了。我已决定使用中给出的解决方案,该解决方案允许我使用| br |作为换行标记。您的示例不起作用,因为|需要出现在行的第一个位置,前面没有空格。