You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When including a heading inside the .. only:: directive, it is somehow reordered.
Expected output:
H's
Subheading
<text>
References
<citations>
<text>
Actual output:
As you can see, the References header is shown after the citations and even the paragraph.
When trying to reproduce this issue, I noticed, that it only works if there is another heading of the same level before the .. only:: directive.
How to Reproduce
index.rst:
####################################
Sphinx Bug Heading In Only Directive
####################################
Reproduction of the bug.
H's
===
Subheading
----------
This is a subheading.
.. only:: html
References
----------
This paragraph is only displayed when generating the HTML output.
.. [CIT] Example citation
This paragraph should be shown *after* the "References" header [CIT]_.
P's
===
.. only:: html
On the other hand, whenever the :code:`only` directive does **not** include a heading, the order is as expected.
This paragraph is shown after the above, at least for HTML output.
Describe the bug
When including a heading inside the
.. only::
directive, it is somehow reordered.Expected output:
<text>
<citations>
<text>
Actual output:
As you can see, the References header is shown after the citations and even the paragraph.
When trying to reproduce this issue, I noticed, that it only works if there is another heading of the same level before the
.. only::
directive.How to Reproduce
index.rst
:Environment Information
Sphinx extensions
Additional context
No response
The text was updated successfully, but these errors were encountered: