about summary refs log tree commit diff
path: root/src/librustdoc/html/markdown/footnotes.rs
AgeCommit message (Collapse)AuthorLines
2025-08-14rustdoc: Allow multiple references to a single footnoteTsukasa OI-9/+24
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. <https://github.com/github/cmark-gfm/blob/587a12bb54d95ac37241377e6ddc93ea0e45439b/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-07-03setup CI and tidy to use typos for spellchecking and fix few typosklensy-2/+2
2024-12-31Fix typosericlehong-1/+1
Signed-off-by: ericlehong <193237094+ericlehong@users.noreply.github.com>
2024-12-05Always display first line of impl blocks even when collapsedGuillaume Gomez-9/+16
2024-11-28Fix new clippy lintsGuillaume Gomez-1/+1
2024-11-14Fix handling of footnote reference in footnote definitionGuillaume Gomez-26/+34
2024-11-13Fix duplicated footnote IDsGuillaume Gomez-14/+19
2024-10-19rustdoc: Refractor footnote handlingAlona Enraght-Moony-36/+67
2024-10-19rustdoc: Extract footnote logic into it's own module.Alona Enraght-Moony-0/+82