Open ClementPinard opened 9 months ago
Thanks for opening your first issue here! Engagement like this is essential for open source projects! :hugs:
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).
Welcome to the EBP community! :tada:
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.