From 4fdd6299b01b059337cdd3f173f5d2699b465f9b Mon Sep 17 00:00:00 2001 From: QuietMisdreavus Date: Fri, 20 Oct 2017 15:12:20 -0500 Subject: [PATCH 1/2] rustdoc: update pulldown renderer fixes #45420 --- src/Cargo.lock | 17 +---------------- src/librustdoc/Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/src/Cargo.lock b/src/Cargo.lock index cd0a09dd725f1..c9c35c08d6b07 100644 --- a/src/Cargo.lock +++ b/src/Cargo.lock @@ -116,11 +116,6 @@ name = "bitflags" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "bitflags" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "bitflags" version = "0.9.1" @@ -1335,14 +1330,6 @@ dependencies = [ "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "pulldown-cmark" -version = "0.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "bitflags 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "pulldown-cmark" version = "0.0.15" @@ -1957,7 +1944,7 @@ dependencies = [ "env_logger 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", "html-diff 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", - "pulldown-cmark 0.0.14 (registry+https://github.com/rust-lang/crates.io-index)", + "pulldown-cmark 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2627,7 +2614,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum backtrace 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "99f2ce94e22b8e664d95c57fff45b98a966c2252b60691d0b7aeeccd88d70983" "checksum backtrace-sys 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)" = "c63ea141ef8fdb10409d0f5daf30ac51f84ef43bff66f16627773d2a292cd189" "checksum bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "aad18937a628ec6abcd26d1489012cc0e18c21798210f491af69ded9b881106d" -"checksum bitflags 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1370e9fc2a6ae53aea8b7a5110edbd08836ed87c88736dfabccade1c2b44bff4" "checksum bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4efd02e230a02e18f92fc2735f44597385ed02ad8f831e7c1c1156ee5e1ab3a5" "checksum bitflags 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f5cde24d1b2e2216a726368b2363a273739c91f4e3eb4e0dd12d672d396ad989" "checksum bufstream 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "f2f382711e76b9de6c744cc00d0497baba02fb00a787f088c879f01d09468e32" @@ -2731,7 +2717,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum precomputed-hash 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "cdf1fc3616b3ef726a847f2cd2388c646ef6a1f1ba4835c2629004da48184150" "checksum procedural-masquerade 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c93cdc1fb30af9ddf3debc4afbdb0f35126cbd99daa229dd76cdd5349b41d989" "checksum psapi-sys 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "abcd5d1a07d360e29727f757a9decb3ce8bc6e0efa8969cfaad669a8317a2478" -"checksum pulldown-cmark 0.0.14 (registry+https://github.com/rust-lang/crates.io-index)" = "d9ab1e588ef8efd702c7ed9d2bd774db5e6f4d878bb5a1a9f371828fbdff6973" "checksum pulldown-cmark 0.0.15 (registry+https://github.com/rust-lang/crates.io-index)" = "378e941dbd392c101f2cb88097fa4d7167bc421d4b88de3ff7dbee503bc3233b" "checksum pulldown-cmark 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a656fdb8b6848f896df5e478a0eb9083681663e37dcb77dd16981ff65329fe8b" "checksum quick-error 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "eda5fe9b71976e62bc81b781206aaa076401769b2143379d3eb2118388babac4" diff --git a/src/librustdoc/Cargo.toml b/src/librustdoc/Cargo.toml index e168222058f9a..988cc08433588 100644 --- a/src/librustdoc/Cargo.toml +++ b/src/librustdoc/Cargo.toml @@ -13,7 +13,7 @@ doctest = false [dependencies] env_logger = { version = "0.4", default-features = false } log = "0.3" -pulldown-cmark = { version = "0.0.14", default-features = false } +pulldown-cmark = { version = "0.1.0", default-features = false } html-diff = "0.0.4" [build-dependencies] From af09ba82e0cd1d5e04e203d3a2eb11cf7ee023dc Mon Sep 17 00:00:00 2001 From: QuietMisdreavus Date: Sat, 21 Oct 2017 15:00:26 -0500 Subject: [PATCH 2/2] change footnote anchor formats to fix spurious rendering differences --- src/librustdoc/html/markdown.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/librustdoc/html/markdown.rs b/src/librustdoc/html/markdown.rs index 80d1f0b01cc26..001e773098eb3 100644 --- a/src/librustdoc/html/markdown.rs +++ b/src/librustdoc/html/markdown.rs @@ -371,7 +371,7 @@ impl<'a, I: Iterator>> Iterator for Footnotes<'a, I> { match self.inner.next() { Some(Event::FootnoteReference(ref reference)) => { let entry = self.get_entry(&reference); - let reference = format!("{0}\ + let reference = format!("{0}\ ", (*entry).1); return Some(Event::Html(reference.into())); @@ -394,7 +394,7 @@ impl<'a, I: Iterator>> Iterator for Footnotes<'a, I> { v.sort_by(|a, b| a.1.cmp(&b.1)); let mut ret = String::from("

    "); for (mut content, id) in v { - write!(ret, "
  1. ", id).unwrap(); + write!(ret, "
  2. ", id).unwrap(); let mut is_paragraph = false; if let Some(&Event::End(Tag::Paragraph)) = content.last() { content.pop(); @@ -402,7 +402,7 @@ impl<'a, I: Iterator>> Iterator for Footnotes<'a, I> { } html::push_html(&mut ret, content.into_iter()); write!(ret, - " ", + " ", id).unwrap(); if is_paragraph { ret.push_str("

    ");