-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Footnotes are squished together by rustdoc when there's no empty line between them #100638
Comments
Transferring to Rust as it is an issue with doc generation. |
I think this is somewhat working as intended. Footnote definitions need to be separated by blank lines. That is not ideal, and I think pulldown-cmark/pulldown-cmark#20 is the closest thing tracking this issue. |
This is the expected behaviour from commonmark as you can see here. Closing then. |
Hi @GuillaumeGomez, CommonMark does not support footnotes at all. RustDoc is very explicit that it does, so the behaviour of RustDoc's footnotes should probably be based on whatever library it uses for Markdown parsing rather than actual CommonMark. You can see from this simple example that CommonMark does not support footnotes: Reference to footnote A[^1].
[^1]: Footnote A. <p>Reference to footnote A[^1].</p>
<p>[^1]: Footnote A.</p> But CommonMark with "extensions" does: <p>Hello, World<a href="#fn1" class="footnote-ref" id="fnref1"
role="doc-noteref"><sup>1</sup></a>!</p>
<section id="footnotes" class="footnotes footnotes-end-of-document"
role="doc-endnotes">
<hr />
<ol>
<li id="fn1"><p>The world is big!<a href="#fnref1" class="footnote-back"
role="doc-backlink">↩︎</a></p></li>
</ol>
</section> |
Oh I see, my apologies. Reopening the issue then. |
cargo doc
when there's no empty line between them
Triage: Still an issue. |
Taking a look. |
…ement, r=fmease Fixes footnote handling in rustdoc Fixes rust-lang#100638. You can now declare footnotes like this: ```rust //! Reference to footnotes A[^1], B[^2] and C[^3]. //! //! [^1]: Footnote A. //! [^2]: Footnote B. //! [^3]: Footnote C. ``` r? `@notriddle`
…ement, r=fmease Fixes footnote handling in rustdoc Fixes rust-lang#100638. You can now declare footnotes like this: ```rust //! Reference to footnotes A[^1], B[^2] and C[^3]. //! //! [^1]: Footnote A. //! [^2]: Footnote B. //! [^3]: Footnote C. ``` r? ``@notriddle``
Rollup merge of rust-lang#120443 - GuillaumeGomez:footnote-def-improvement, r=fmease Fixes footnote handling in rustdoc Fixes rust-lang#100638. You can now declare footnotes like this: ```rust //! Reference to footnotes A[^1], B[^2] and C[^3]. //! //! [^1]: Footnote A. //! [^2]: Footnote B. //! [^3]: Footnote C. ``` r? `@notriddle`
Problem
Footnote lines, when written on adjacent lines, squish into a single footnote:
Steps
Copy-paste the following snippet at the top of a new module:
Run
cargo doc
.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:
It's not pretty, though.
Version
The text was updated successfully, but these errors were encountered: