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
It looks like this works for myst parser but only for two headings. As soon as there are 3 headings with the same name (can happen with subsections that follow a pattern between sections), any cross ref fails
See how I get the warning 'myst' reference target not found: 'heading-2' [myst.xref_missing] even though the slug does exist in the html.
Expected Behavior
[Link to the heading 3](#heading-2) should link to the third occurence of the heading titled "heading" and not issue a warning
# Heading
Hallo world!
[Link to the heading](#heading)[Link to the heading 2](#heading-1)[Link to the heading 3](#heading-2)# Heading
The second heading
# Heading
the third heading
Thanks for opening your first issue here! Engagement like this is essential for open source projects! 🤗
If you haven't done so already, check out EBP's Code of Conduct. Also, please try to follow the issue template as it helps other community members to contribute more effectively.
If your issue is a feature request, others may react to it, to raise its prominence (see Feature Voting).
What version of
myst-parser
are you using?2.0.0
What version dependencies are you using?
sphinx : 6.2.1
docutils 0.19
What operating system are you using?
Ubuntu 22.04
Describe the Bug
In the docs (especially here https://myst-parser.readthedocs.io/en/latest/syntax/cross-referencing.html#implicit-targets) it says that the slugs for headings matches the github slugger.
As such, when headings have the same name, the second occurence gets a suffix of
-1
, and the third should get-2
and so on.It looks like this works for myst parser but only for two headings. As soon as there are 3 headings with the same name (can happen with subsections that follow a pattern between sections), any cross ref fails
See how I get the warning
'myst' reference target not found: 'heading-2' [myst.xref_missing]
even though the slug does exist in the html.Expected Behavior
[Link to the heading 3](#heading-2)
should link to the third occurence of the heading titled "heading" and not issue a warningTo Reproduce
This bug is very to reproduce since it happens on the live preview
https://myst-parser.readthedocs.io/en/latest/live-preview.html#
I kept the default configuration, i.e.
The text was updated successfully, but these errors were encountered: