【发布时间】:2021-01-18 09:28:47
【问题描述】:
我有一个 reStructuredText 表,其中一行如下:
+------+-----------------------------+
| Mask | The bit mask: |
| | [bit 0] Description of bit0 |
| | [bit 1] And bit1 |
+------+-----------------------------+
Sphinx 生成的单元格(以 HTML 为例)是这样的:
<td><p>The bit mask:
[bit 0] Description of bit0
[bit 1] And bit1</p></td>
我想要的是这个(或类似的),其中至少在每个新行之前强制换行:
<td><p>The bit mask:
<br>[bit 0] Description of bit0
<br>[bit 1] And bit1</p></td>
有没有办法可以配置 Sphinx 以尊重 reStructuredText 表格单元格中的行?
(作为参考,这里是当前制作的整个表格:)
<table class="docutils align-default">
<colgroup>
<col style="width: 17%" />
<col style="width: 83%" />
</colgroup>
<tbody>
<tr class="row-odd">
<td>
<p>Mask</p>
</td>
<td>
<p>The bit mask:
[bit 0] Description of bit0
[bit 1] And bit1
</p>
</td>
</tr>
</tbody>
</table>
【问题讨论】:
标签: html-table python-sphinx line-breaks restructuredtext