Skip to content

Commit bd7e8b5

Browse files
Rollup merge of rust-lang#111152 - lukas-code:markdown-parsers-are-hard, r=GuillaumeGomez
update `pulldown-cmark` to `0.9.3` This PR updates `pulldown-cmark` to version `0.9.3`, which does two main things: * Pulls in pulldown-cmark/pulldown-cmark#643 to fix rust-lang#111117 * Allows parsing strikethrough with single tildes, e.g. `~foo~` -> ~foo~. This matches the [GFM spec](https://github.github.com/gfm/#strikethrough-extension-). Full changelog: pulldown-cmark/pulldown-cmark#646
2 parents fb45513 + c2a446a commit bd7e8b5

File tree

7 files changed

+41
-16
lines changed

7 files changed

+41
-16
lines changed

Cargo.lock

+2-2
Original file line numberDiff line numberDiff line change
@@ -2779,9 +2779,9 @@ dependencies = [
27792779

27802780
[[package]]
27812781
name = "pulldown-cmark"
2782-
version = "0.9.2"
2782+
version = "0.9.3"
27832783
source = "registry+https://github.com/rust-lang/crates.io-index"
2784-
checksum = "2d9cc634bc78768157b5cbfe988ffcd1dcba95cd2b2f03a88316c08c6d00ed63"
2784+
checksum = "77a1a2f1f0a7ecff9c31abbe177637be0e97a0aef46cf8738ece09327985d998"
27852785
dependencies = [
27862786
"bitflags",
27872787
"memchr",

compiler/rustc_resolve/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ edition = "2021"
77

88
[dependencies]
99
bitflags = "1.2.1"
10-
pulldown-cmark = { version = "0.9.2", default-features = false }
10+
pulldown-cmark = { version = "0.9.3", default-features = false }
1111
rustc_arena = { path = "../rustc_arena" }
1212
rustc_ast = { path = "../rustc_ast" }
1313
rustc_ast_pretty = { path = "../rustc_ast_pretty" }

src/doc/rustdoc/src/how-to-write-documentation.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -165,15 +165,15 @@ extensions:
165165
### Strikethrough
166166

167167
Text may be rendered with a horizontal line through the center by wrapping the
168-
text with two tilde characters on each side:
168+
text with one or two tilde characters on each side:
169169

170170
```text
171-
An example of ~~strikethrough text~~.
171+
An example of ~~strikethrough text~~. You can also use ~single tildes~.
172172
```
173173

174174
This example will render as:
175175

176-
> An example of ~~strikethrough text~~.
176+
> An example of ~~strikethrough text~~. You can also use ~single tildes~.
177177
178178
This follows the [GitHub Strikethrough extension][strikethrough].
179179

tests/rustdoc-ui/unescaped_backticks.rs

+12
Original file line numberDiff line numberDiff line change
@@ -340,3 +340,15 @@ id! {
340340
/// level changes.
341341
pub mod tracing_macro {}
342342
}
343+
344+
/// Regression test for <https://github.com/rust-lang/rust/issues/111117>
345+
pub mod trillium_server_common {
346+
/// One-indexed, because the first CloneCounter is included. If you don't
347+
/// want the original to count, construct a [``CloneCounterObserver`]
348+
/// instead and use [`CloneCounterObserver::counter`] to increment.
349+
//~^ ERROR unescaped backtick
350+
pub struct CloneCounter;
351+
352+
/// This is used by the above.
353+
pub struct CloneCounterObserver;
354+
}

tests/rustdoc-ui/unescaped_backticks.stderr

+13-1
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,18 @@ LL | | /// level changes.
341341
change: [`rebuild_interest_cache`][rebuild] is called after the value of the max
342342
to this: [`rebuild_interest_cache\`][rebuild] is called after the value of the max
343343

344+
error: unescaped backtick
345+
--> $DIR/unescaped_backticks.rs:348:56
346+
|
347+
LL | /// instead and use [`CloneCounterObserver::counter`] to increment.
348+
| ^
349+
|
350+
= help: the opening or closing backtick of an inline code may be missing
351+
help: if you meant to use a literal backtick, escape it
352+
|
353+
LL | /// instead and use [`CloneCounterObserver::counter\`] to increment.
354+
| +
355+
344356
error: unescaped backtick
345357
--> $DIR/unescaped_backticks.rs:11:5
346358
|
@@ -955,5 +967,5 @@ help: if you meant to use a literal backtick, escape it
955967
LL | /// | table`( | )\`body |
956968
| +
957969

958-
error: aborting due to 63 previous errors
970+
error: aborting due to 64 previous errors
959971

tests/rustdoc/strikethrough-in-summary.rs

-6
This file was deleted.

tests/rustdoc/test-strikethrough.rs

+10-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
#![crate_name = "foo"]
22

3-
// @has foo/fn.f.html
4-
// @has - //del "Y"
5-
/// ~~Y~~
3+
// Test that strikethrough works with single and double tildes and that it shows up on
4+
// the item's dedicated page as well as the parent module's summary of items.
5+
6+
// @has foo/index.html //del 'strike'
7+
// @has foo/index.html //del 'through'
8+
9+
// @has foo/fn.f.html //del 'strike'
10+
// @has foo/fn.f.html //del 'through'
11+
12+
/// ~~strike~~ ~through~
613
pub fn f() {}

0 commit comments

Comments
 (0)