strange behavior when table meets CJK character #266
-
sometimes the last character always in a new line alone, like these: it should be this: test rst ========== ========
返回值类型 解释
========== ========
nil 无返回值
========== ======== |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hiya! Thanks for flagging this! This seems to come from Sphinx itself, specifically from docutils (which is what Sphinx is built upon, to render the <table class="docutils align-default">
<colgroup>
<col style="width: 56%">
<col style="width: 44%">
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>返回值类型</p></th>
<th class="head"><p>解释</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>nil</p></td>
<td><p>无返回值</p></td>
</tr>
</tbody>
</table> The issue is the colgroup, which seems to be have been calculated incorrectly for CJK characters, and forces that rewrapping. I'm able to reproduce the issue with a plain <table class="docutils align-default" border="1">
<colgroup>
<col style="width: 56%">
<col style="width: 44%">
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>返回值类型</p></th>
<th class="head"><p>解释</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>nil</p></td>
<td><p>无返回值</p></td>
</tr>
</tbody>
</table> Dropping the colgroup fixes things, so does tweaking the percentages on the colgroup to Overall, this is definitely a bug. It originates from a part of the toolchain that I don't control though, and I'd encourage you to reach out to the docutils project (see "If you find a bug" in https://docutils.sourceforge.io/#overview) and pursue them to fix this. |
Beta Was this translation helpful? Give feedback.
Hiya! Thanks for flagging this!
This seems to come from Sphinx itself, specifically from docutils (which is what Sphinx is built upon, to render the
.rst
files). Here's the final HTML that is provided to the Sphinx themes (in this case, Furo) to stylise:The issue is the colgroup, which seems to be have been calculated incorrectly for CJK characters, and forces that rewrapping. …