mirror of
https://github.com/neovim/neovim.git
synced 2025-10-26 12:27:24 +00:00
The markup for footonotes [1] and citations [2] are almost identical.
The difference is that footnotes allow numeric values but citations
allow every valid reference name except numeric values.
The regex for matching citations currently only checks for valid
reference names but does not exclude number-only labels, thus also
matches numeric footnotes. To match such footnotes, e.g. ``[1]`` define
the syntax rule for footnotes after the syntax rule for citations so it
gets higher precedence and matches first.
[1] https://docutils.sourceforge.io/docs/ref/rst/restructuredtext.html#footnotes
[2] https://docutils.sourceforge.io/docs/ref/rst/restructuredtext.html#citations
related: vim/vim#18566
5485827c5f
Co-authored-by: Kirk Roemer <91125534+kirk-roemer@users.noreply.github.com>