From: Günter M. <mi...@us...> - 2022-05-31 18:35:26
|
> Reproducer: > ```pycon >>>> 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. This actually happens for all "image" and "figure" directives with attributes:: Test the best .. image:: placeholder_image.jpg .. image:: placeholder_image.jpg :name: testimage .. image:: placeholder_image.jpg :alt: blah .. image:: placeholder_image.jpg :class: spam .. image:: placeholder_image.jpg :width: 30% .. figure:: placeholder_image.jpg .. figure:: placeholder_image.jpg :align: right conversion with `rst2pseudoxml --expose-internal-attribute=line` also reveals that the line info in <image> and <figure> elements without attributes is off by one. --- ** [bugs:#449] Image has no line number with an `:alt:` attribute** **Status:** open **Created:** Tue May 31, 2022 05:20 PM UTC by Adam Turner **Last Updated:** Tue May 31, 2022 05:20 PM UTC **Owner:** nobody Reproducer: ```pycon >>> 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 --- Sent from sourceforge.net because doc...@li... is subscribed to https://sourceforge.net/p/docutils/bugs/ To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/docutils/admin/bugs/options. Or, if this is a mailing list, you can unsubscribe from the mailing list. |