MyST-Parser
MyST-Parser copied to clipboard
Add warning for invalid footnotes reference (and unused definitions)
What version of myst-parser
are you using?
3.0.1
What version dependencies are you using?
Sphinx 7.2.6 docutils 0.20.1
What operating system are you using?
Mac
Describe the Bug
If a Markdown footnote does not have a corresponding reference in either direction, no warnings are emitted. Compare the equivalent RST and Markdown:
Lorem ipsum [#f1]_ dolor sit amet ... [#f2]_
.. rubric:: Footnotes
.. [#f1] Text of the first footnote.
.. [#f3] Text of the second footnote.
Lorem ipsum [^f1] dolor sit amet ... [^f2]
```{rubric} Footnotes
```
[^f1]: Text of the first footnote.
[^f3]: Text of the second footnote.
The first one gives two warnings in the build
test.rst:1: ERROR: Too many autonumbered footnote references: only 0 corresponding footnotes available.
test.rst:1: ERROR: Unknown target name: "f2".
The second one gives no warnings. The resulting document just has a literal [^f2] in the text.
Expected Behavior
An invalid footnote should produce a warning, ideally in both directions, since it is an invalid cross-reference.
To Reproduce
No response