forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#120443 - GuillaumeGomez:footnote-def-improv…
…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``
- Loading branch information
Showing
3 changed files
with
19 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
tests/rustdoc/footnote-definition-without-blank-line-100638.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#![crate_name = "foo"] | ||
|
||
//! Reference to footnotes A[^1], B[^2] and C[^3]. | ||
//! | ||
//! [^1]: Footnote A. | ||
//! [^2]: Footnote B. | ||
//! [^3]: Footnote C. | ||
|
||
// @has 'foo/index.html' | ||
// @has - '//*[@class="docblock"]/*[@class="footnotes"]/ol/li[@id="fn1"]/p' 'Footnote A' | ||
// @has - '//li[@id="fn1"]/p/a/@href' '#fnref1' | ||
// @has - '//*[@class="docblock"]/*[@class="footnotes"]/ol/li[@id="fn2"]/p' 'Footnote B' | ||
// @has - '//li[@id="fn2"]/p/a/@href' '#fnref2' | ||
// @has - '//*[@class="docblock"]/*[@class="footnotes"]/ol/li[@id="fn3"]/p' 'Footnote C' | ||
// @has - '//li[@id="fn3"]/p/a/@href' '#fnref3' |