Sphinx: Multiple footnotes render as multiple tables

Created on 3 Jan 2015  路  7Comments  路  Source: sphinx-doc/sphinx

Input

#!rst

Bla bla [#]_ and blah [#]_

.. [#] first
.. [#] second

Output

#!html
<p>Bla bla <a class="footnote-reference" href="#id9" id="id7">[4]</a> and blah <a class="footnote-reference" href="#id10" id="id8">[5]</a></p>
<table class="docutils footnote" frame="void" id="id9" rules="none">
<colgroup><col class="label" /><col /></colgroup>
<tbody valign="top">
<tr><td class="label"><a class="fn-backref" href="#id7">[4]</a></td><td>first</td></tr>
</tbody>
</table>
<table class="docutils footnote" frame="void" id="id10" rules="none">
<colgroup><col class="label" /><col /></colgroup>
<tbody valign="top">
<tr><td class="label"><a class="fn-backref" href="#id8">[5]</a></td><td>second</td></tr>
</tbody>
</table>

enhancement html low proposal

Most helpful comment

any news here?

All 7 comments

_From Takayuki Shimizukawa on 2014-09-23 03:44:38+00:00_

Thanks for reporting.

Let me clarify, do you think it should be rendered by one table with 2 rows?

_From PJK on 2014-09-25 18:50:33+00:00_

I'd expect the output to be something along the lines of

#!html

<p>Bla bla <a class="footnote-reference" href="#id9" id="id7">[4]</a> and blah <a class="footnote-reference" href="#id10" id="id8">[5]</a></p>

<table class="docutils footnote" frame="void" id="id9" rules="none">
<colgroup><col class="label" /><col /></colgroup>
<tbody valign="top">
<tr><td class="label"><a class="fn-backref" href="#id7">[4]</a></td><td>first</td></tr>
<tr><td class="label"><a class="fn-backref" href="#id8">[5]</a></td><td>second</td></tr>
</tbody>
</table>

So yes, one table with two rows. Is the current behaviour intentional?

_From Takayuki Shimizukawa on 2014-09-26 13:37:59+00:00_

PJK yes, it's intentional behavior. It is implemented at docutils (super layer of sphinx). If we want to merge them into one table, we need to re-implement a part of docutils html4css1 writer by sphinx side.

Pull request, patch, suggestion are always welcome ;)

_From PJK on 2014-09-26 13:56:19+00:00_

Great, thanks for explaining that. http://repo.or.cz/w/docutils.git/blob/HEAD:/docutils/docutils/writers/html4css1/__init__.py#l944 seems to be the problem. I'll report this in docutils' tracker

Is there any progress at docutils regarding this issue?

I consider this a bug, because

  • there is no sense to create a table for only one line.
  • having more then 10 footnotes will cause a miss-alignment of columns

Moreover, it's questionable why it creates tables, because the tables are used for styling and not for data presentation.

This is an example, generated by sphinx + docutils: One HTML table per footnote

docutils_bug1

This is the result after manually correcting the HTML source file:

docutils_bug2

any news here?

No updates. We have tons of issues now. So we could not work only for this. if you want to fix this earlier, please send us pull request. We're always welcome your PR :-)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

samweisgamdschie picture samweisgamdschie  路  3Comments

ubershmekel picture ubershmekel  路  3Comments

shimizukawa picture shimizukawa  路  3Comments

jfbu picture jfbu  路  3Comments

pgjones picture pgjones  路  3Comments