Skip to content

Commit f35504d

Browse files
Rollup merge of #120443 - GuillaumeGomez:footnote-def-improvement, r=fmease
Fixes footnote handling in rustdoc Fixes #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`
2 parents 3524d8a + 1e60cc9 commit f35504d

File tree

3 files changed

+19
-4
lines changed

3 files changed

+19
-4
lines changed

Cargo.lock

+3-3
Original file line numberDiff line numberDiff line change
@@ -3003,11 +3003,11 @@ dependencies = [
30033003

30043004
[[package]]
30053005
name = "pulldown-cmark"
3006-
version = "0.9.3"
3006+
version = "0.9.6"
30073007
source = "registry+https://github.com/rust-lang/crates.io-index"
3008-
checksum = "77a1a2f1f0a7ecff9c31abbe177637be0e97a0aef46cf8738ece09327985d998"
3008+
checksum = "57206b407293d2bcd3af849ce869d52068623f19e1b5ff8e8778e3309439682b"
30093009
dependencies = [
3010-
"bitflags 1.3.2",
3010+
"bitflags 2.4.1",
30113011
"memchr",
30123012
"unicase",
30133013
]

compiler/rustc_resolve/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ edition = "2021"
66
[dependencies]
77
# tidy-alphabetical-start
88
bitflags = "2.4.1"
9-
pulldown-cmark = { version = "0.9.3", default-features = false }
9+
pulldown-cmark = { version = "0.9.6", default-features = false }
1010
rustc_arena = { path = "../rustc_arena" }
1111
rustc_ast = { path = "../rustc_ast" }
1212
rustc_ast_pretty = { path = "../rustc_ast_pretty" }
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#![crate_name = "foo"]
2+
3+
//! Reference to footnotes A[^1], B[^2] and C[^3].
4+
//!
5+
//! [^1]: Footnote A.
6+
//! [^2]: Footnote B.
7+
//! [^3]: Footnote C.
8+
9+
// @has 'foo/index.html'
10+
// @has - '//*[@class="docblock"]/*[@class="footnotes"]/ol/li[@id="fn1"]/p' 'Footnote A'
11+
// @has - '//li[@id="fn1"]/p/a/@href' '#fnref1'
12+
// @has - '//*[@class="docblock"]/*[@class="footnotes"]/ol/li[@id="fn2"]/p' 'Footnote B'
13+
// @has - '//li[@id="fn2"]/p/a/@href' '#fnref2'
14+
// @has - '//*[@class="docblock"]/*[@class="footnotes"]/ol/li[@id="fn3"]/p' 'Footnote C'
15+
// @has - '//li[@id="fn3"]/p/a/@href' '#fnref3'

0 commit comments

Comments
 (0)