third occurence of heading with the same title cannot be referenced, [myst.xref_missing]
#878
Labels
bug
Something isn't working
[myst.xref_missing]
#878
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: