Skip to content

Commit 1357c67

Browse files
eucliopietroalbini
authored andcommitted
upgrade rustdoc's pulldown-cmark to 0.5.2
Fixes #60482.
1 parent c8f722b commit 1357c67

File tree

4 files changed

+22
-24
lines changed

4 files changed

+22
-24
lines changed

Cargo.lock

+7-18
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ dependencies = [
409409
"itertools 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
410410
"lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
411411
"matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
412-
"pulldown-cmark 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
412+
"pulldown-cmark 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)",
413413
"quine-mc_cluskey 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
414414
"regex-syntax 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)",
415415
"semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -2001,23 +2001,13 @@ dependencies = [
20012001

20022002
[[package]]
20032003
name = "pulldown-cmark"
2004-
version = "0.4.1"
2005-
source = "registry+https://github.com/rust-lang/crates.io-index"
2006-
dependencies = [
2007-
"bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
2008-
"memchr 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
2009-
"unicase 2.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
2010-
]
2011-
2012-
[[package]]
2013-
name = "pulldown-cmark"
2014-
version = "0.5.0"
2004+
version = "0.5.2"
20152005
source = "registry+https://github.com/rust-lang/crates.io-index"
20162006
dependencies = [
20172007
"bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
20182008
"getopts 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)",
20192009
"memchr 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
2020-
"unicase 2.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
2010+
"unicase 2.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
20212011
]
20222012

20232013
[[package]]
@@ -3062,7 +3052,7 @@ version = "0.0.0"
30623052
dependencies = [
30633053
"minifier 0.0.30 (registry+https://github.com/rust-lang/crates.io-index)",
30643054
"parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
3065-
"pulldown-cmark 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
3055+
"pulldown-cmark 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)",
30663056
"tempfile 3.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
30673057
]
30683058

@@ -3824,7 +3814,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
38243814

38253815
[[package]]
38263816
name = "unicase"
3827-
version = "2.3.0"
3817+
version = "2.4.0"
38283818
source = "registry+https://github.com/rust-lang/crates.io-index"
38293819
dependencies = [
38303820
"version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -4241,8 +4231,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
42414231
"checksum proc-macro2 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)" = "77619697826f31a02ae974457af0b29b723e5619e113e9397b8b82c6bd253f09"
42424232
"checksum proptest 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)" = "24f5844db2f839e97e3021980975f6ebf8691d9b9b2ca67ed3feb38dc3edb52c"
42434233
"checksum pulldown-cmark 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d6fdf85cda6cadfae5428a54661d431330b312bc767ddbc57adbedc24da66e32"
4244-
"checksum pulldown-cmark 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d1b74cc784b038a9921fd1a48310cc2e238101aa8ae0b94201e2d85121dd68b5"
4245-
"checksum pulldown-cmark 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "157737d41407de9c5e0563a991d085117d60ae729af2cc1bf28d6dfbc97bcc1f"
4234+
"checksum pulldown-cmark 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "051e60ace841b3bfecd402fe5051c06cb3bec4a6e6fdd060a37aa8eb829a1db3"
42464235
"checksum quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9274b940887ce9addde99c4eee6b5c44cc494b182b97e73dc8ffdcb3397fd3f0"
42474236
"checksum quine-mc_cluskey 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "07589615d719a60c8dd8a4622e7946465dfef20d1a428f969e3443e7386d5f45"
42484237
"checksum quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e920b65c65f10b2ae65c831a81a073a89edd28c7cce89475bff467ab4167a"
@@ -4354,7 +4343,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
43544343
"checksum typenum 1.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "612d636f949607bdf9b123b4a6f6d966dedf3ff669f7f045890d3a4a73948169"
43554344
"checksum ucd-trie 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "71a9c5b1fe77426cf144cc30e49e955270f5086e31a6441dfa8b32efc09b9d77"
43564345
"checksum ucd-util 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "535c204ee4d8434478593480b8f86ab45ec9aae0e83c568ca81abf0fd0e88f86"
4357-
"checksum unicase 2.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "41d17211f887da8e4a70a45b9536f26fc5de166b81e2d5d80de4a17fd22553bd"
4346+
"checksum unicase 2.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a84e5511b2a947f3ae965dcb29b13b7b1691b6e7332cf5dbc1744138d5acb7f6"
43584347
"checksum unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5"
43594348
"checksum unicode-normalization 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "6a0180bc61fc5a987082bfa111f4cc95c4caff7f9799f3e46df09163a937aa25"
43604349
"checksum unicode-segmentation 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "aa6024fc12ddfd1c6dbc14a80fa2324d4568849869b779f6bd37e5e4c03344d1"

src/librustdoc/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ name = "rustdoc"
99
path = "lib.rs"
1010

1111
[dependencies]
12-
pulldown-cmark = { version = "0.4.1", default-features = false }
12+
pulldown-cmark = { version = "0.5.2", default-features = false }
1313
minifier = "0.0.30"
1414
tempfile = "3"
1515
parking_lot = "0.7"

src/librustdoc/html/markdown.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -351,9 +351,11 @@ impl<'a, 'b, 'ids, I: Iterator<Item = Event<'a>>> Iterator for HeadingLinks<'a,
351351
if let Some(Event::Start(Tag::Header(level))) = event {
352352
let mut id = String::new();
353353
for event in &mut self.inner {
354-
match event {
354+
match &event {
355355
Event::End(Tag::Header(..)) => break,
356-
Event::Text(ref text) => id.extend(text.chars().filter_map(slugify)),
356+
Event::Text(text) | Event::Code(text) => {
357+
id.extend(text.chars().filter_map(slugify));
358+
}
357359
_ => {},
358360
}
359361
self.buf.push_back(event);
@@ -402,7 +404,6 @@ fn check_if_allowed_tag(t: &Tag<'_>) -> bool {
402404
| Tag::Item
403405
| Tag::Emphasis
404406
| Tag::Strong
405-
| Tag::Code
406407
| Tag::Link(..)
407408
| Tag::BlockQuote => true,
408409
_ => false,
@@ -790,9 +791,8 @@ pub fn plain_summary_line_full(md: &str, limit_length: bool) -> String {
790791
let next_event = next_event.unwrap();
791792
let (ret, is_in) = match next_event {
792793
Event::Start(Tag::Paragraph) => (None, 1),
793-
Event::Start(Tag::Code) => (Some("`".to_owned()), 1),
794-
Event::End(Tag::Code) => (Some("`".to_owned()), -1),
795794
Event::Start(Tag::Header(_)) => (None, 1),
795+
Event::Code(code) => (Some(format!("`{}`", code)), 0),
796796
Event::Text(ref s) if self.is_in > 0 => (Some(s.as_ref().to_owned()), 0),
797797
Event::End(Tag::Paragraph) | Event::End(Tag::Header(_)) => (None, -1),
798798
_ => (None, 0),

src/test/rustdoc/issue-60482.rs

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// This code caused a panic in `pulldown-cmark` 0.4.1.
2+
3+
pub const BASIC_UNICODE: bool = true;
4+
5+
6+
/// # `BASIC_UNICODE`: `A` `|`
7+
/// ```text
8+
/// ```
9+
pub const BASIC_FONTS: bool = true;

0 commit comments

Comments
 (0)