Skip to content

Footnotes are squished together by rustdoc when there's no empty line between them #100638

Closed

Description

Problem

Footnote lines, when written on adjacent lines, squish into a single footnote:

//! [^1]: Footnote A.
//! [^2]: Footnote B.
//! [^3]: Footnote C.

Screenshot 2022-08-16 at 18 39 09

Steps

  1. Copy-paste the following snippet at the top of a new module:

    //! Reference to footnotes A[^1], B[^2] and C[^3].
    //!
    //! [^1]: Footnote A.
    //! [^2]: Footnote B.
    //! [^3]: Footnote C.
  2. Run cargo doc.

  3. Observe that the footnotes have been incorrectly rendered as a single footnote.

Possible Solution(s)

No response

Notes

One workaround is to separate the footnotes with empty lines:

//! [^1]: Footnote A.
//! 
//! [^2]: Footnote B.
//! 
//! [^3]: Footnote C.

It's not pretty, though.

Version

cargo 1.64.0-nightly (b1dd22e66 2022-07-09)
release: 1.64.0-nightly
commit-hash: b1dd22e668af5279e13a071ad4b17435bd6bfa4c
commit-date: 2022-07-09
host: x86_64-apple-darwin
libgit2: 1.4.2 (sys:0.14.2 vendored)
libcurl: 7.79.1 (sys:0.4.55+curl-7.83.1 system ssl:(SecureTransport) LibreSSL/3.3.6)
os: Mac OS 12.5.0 [64-bit]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    A-rustdoc-uiArea: Rustdoc UI (generated HTML)C-bugCategory: This is a bug.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions