Tsukasa OI 74aca53f55 rustdoc: Allow multiple references to a single footnote
Multiple references to a single footnote is a part of GitHub Flavored
Markdown syntax (although not explicitly documented as well as regular
footnotes, it is implemented in GitHub's fork of CommonMark) and not
prohibited by rustdoc.

cf. <587a12bb54/test/extensions.txt (L762-L780)>

However, using it makes multiple "sup" elements with the same "id"
attribute, which is invalid per the HTML specification.

Still, not only this is a valid GitHub Flavored Markdown syntax, this is
helpful on certain cases and actually tested (accidentally) in
tests/rustdoc/footnote-reference-in-footnote-def.rs.

This commit keeps track of the number of references per footnote and gives
unique ID to each reference.  It also emits *all* back links from a footnote
to its references as "↩" (return symbol) plus a numeric list in superscript.

As a known limitation, it assumes that all references to a footnote are
rendered (this is not always true if a dangling footnote has one or more
references but considered a reasonable compromise).

Also note that, this commit is designed so that no HTML changes will occur
unless multiple references to a single footnote is actually used.
2025-08-14 04:39:31 +00:00
..
2025-07-28 13:34:03 +01:00
2025-02-23 22:24:00 +05:30
2024-06-24 11:08:41 +02:00
2024-11-03 18:59:31 +00:00
2025-01-18 20:29:55 +01:00
2025-01-18 20:29:55 +01:00
2024-09-23 09:21:39 -07:00
2025-01-18 20:29:55 +01:00
2025-01-18 20:29:55 +01:00
2025-01-18 20:29:55 +01:00
2024-08-05 11:04:51 +02:00
2025-01-18 20:29:55 +01:00
2024-09-23 09:21:39 -07:00