Reproducer:
>>> print(core.publish_doctree(".. image:: placeholder_image.jpg")[0].line)
1
>>> print(core.publish_doctree(".. image:: placeholder_image.jpg\n :alt: blah")[0].line)
None
This is rather odd! Originally found whilst debugging a Sphinx issue.
A
This actually happens for all "image" and "figure" directives with
attributes::
conversion with
rst2pseudoxml --expose-internal-attribute=linealsoreveals that the line info in
<image>and<figure>elements withoutattributes is off by one.
Last edit: Günter Milde 2022-06-01
I'm looking into line numbering anyway, so hopefully I might be able to fix both issues at once.
A
One more instance of [#41].
Related
Feature Requests: #41
Last edit: Günter Milde 2022-06-01