From ba2ef69c7970a6e8b150ca85b0c7975e6105ffe5 Mon Sep 17 00:00:00 2001 From: Moritz Vetter Date: Sun, 6 Feb 2022 09:04:06 +0100 Subject: [PATCH] Bump pulldown-cmark-to-cmark, adjust usages and fix test --- Cargo.lock | 4 ++-- crates/ide/Cargo.toml | 2 +- crates/ide/src/doc_links.rs | 6 +++--- crates/ide/src/doc_links/tests.rs | 6 +----- 4 files changed, 7 insertions(+), 11 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8457c43bb6a..0ab9f89fd2c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1245,9 +1245,9 @@ dependencies = [ [[package]] name = "pulldown-cmark-to-cmark" -version = "9.0.0" +version = "10.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f94dc756ef5c50ad28ccea8428ba5de9f4dca1fff6516a26b85e0b125a70d17" +checksum = "d1dd19382cbbcee6ce498f65d5acaa6016e41ec701c9b0aef29a689bd7062f88" dependencies = [ "pulldown-cmark", ] diff --git a/crates/ide/Cargo.toml b/crates/ide/Cargo.toml index 250673d3fe7..1df2942bdc0 100644 --- a/crates/ide/Cargo.toml +++ b/crates/ide/Cargo.toml @@ -17,7 +17,7 @@ itertools = "0.10.0" tracing = "0.1" rustc-hash = "1.1.0" oorandom = "11.1.2" -pulldown-cmark-to-cmark = "9.0" +pulldown-cmark-to-cmark = "10.0.0" pulldown-cmark = { version = "0.9", default-features = false } url = "2.1.1" dot = "0.1.4" diff --git a/crates/ide/src/doc_links.rs b/crates/ide/src/doc_links.rs index c8a645b0320..00b33c834c0 100644 --- a/crates/ide/src/doc_links.rs +++ b/crates/ide/src/doc_links.rs @@ -7,7 +7,7 @@ use either::Either; use pulldown_cmark::{BrokenLink, CowStr, Event, InlineStr, LinkType, Options, Parser, Tag}; -use pulldown_cmark_to_cmark::{cmark_with_options, Options as CMarkOptions}; +use pulldown_cmark_to_cmark::{cmark_resume_with_options, Options as CMarkOptions}; use stdx::format_to; use url::Url; @@ -61,7 +61,7 @@ pub(crate) fn rewrite_links(db: &RootDatabase, markdown: &str, definition: Defin } }); let mut out = String::new(); - cmark_with_options( + cmark_resume_with_options( doc, &mut out, None, @@ -97,7 +97,7 @@ pub(crate) fn remove_links(markdown: &str) -> String { }); let mut out = String::new(); - cmark_with_options( + cmark_resume_with_options( doc, &mut out, None, diff --git a/crates/ide/src/doc_links/tests.rs b/crates/ide/src/doc_links/tests.rs index 27a70b18aa0..477326c61fc 100644 --- a/crates/ide/src/doc_links/tests.rs +++ b/crates/ide/src/doc_links/tests.rs @@ -394,7 +394,6 @@ fn rewrite_struct() { "#, expect![[r#"[my Foo](https://docs.rs/foo/*/foo/struct.Foo.html)"#]], ); - // FIXME #11008 check_rewrite( r#" //- /main.rs crate:foo @@ -403,9 +402,6 @@ fn rewrite_struct() { /// [`foo`]: Foo pub struct $0Foo; "#, - expect![[r#" - [`foo`] - - []: https://docs.rs/foo/*/foo/struct.Foo.html"#]], + expect![["[`foo`]"]], ); }