-
Notifications
You must be signed in to change notification settings - Fork 195
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add warning for invalid footnotes reference (and unused definitions) #930
Comments
Note, a problem with this is it is basically an intended part of commonmark; that square brackets |
Looking at djot, they do indeed always treat (you'll note in https://github.com/jgm/djot, general shortcut link syntax |
Thinking about this now actually, perhaps a route to removing the annoying "lazy" behaviour of shortcut link references like footnote references are never parsed as text [^footnote]
link shortcuts starting with `[=` are never parsed as text (and the `=` is removed from the link) [=reference]
[^footnote]: This is a footnote
[reference]: https://example.com goes to: <p>footnote references are never parsed as text <a id="fnref1" href="#fn1"><sup>1</sup></a></p>
<p>link shortcuts starting with <code>[=</code> are never parsed as text (and the <code>=</code> is removed from the link) <a href="https://example.com">reference</a></p>
<section role="doc-endnotes">
<hr>
<ol>
<li id="fn1">
<p>This is a footnote<a href="#fnref1">↩︎</a></p>
</li>
</ol>
</section> |
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:
The first one gives two warnings in the build
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
The text was updated successfully, but these errors were encountered: