From b30a1cde7c059b7e787f30c689d3413025b5dc9e Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 22 Nov 2024 10:45:11 +0000 Subject: [PATCH 1/2] Update Rust crate comrak to v0.30.0 --- Cargo.lock | 6 +++--- crates/crates_io_markdown/Cargo.toml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index aeeb45a8f8e..0b0e8853fe8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -944,12 +944,12 @@ dependencies = [ [[package]] name = "comrak" -version = "0.29.0" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8c32ff8b21372fab0e9ecc4e42536055702dc5faa418362bffd1544f9d12637" +checksum = "949f8e6b02ebac005a8be2df9ec0876cafc83fdb9c510796c37f0fadf92dcd0e" dependencies = [ + "bon", "caseless", - "derive_builder", "entities", "memchr", "once_cell", diff --git a/crates/crates_io_markdown/Cargo.toml b/crates/crates_io_markdown/Cargo.toml index 52abb0205af..416712c4abb 100644 --- a/crates/crates_io_markdown/Cargo.toml +++ b/crates/crates_io_markdown/Cargo.toml @@ -14,7 +14,7 @@ path = "lib.rs" [dependencies] ammonia = "=4.0.0" -comrak = { version = "=0.29.0", default-features = false } +comrak = { version = "=0.30.0", default-features = false } htmlescape = "=0.3.1" url = "=2.5.3" From e872d39f9512b897f04421fb4468b4e18af53cdd Mon Sep 17 00:00:00 2001 From: Tobias Bieniek Date: Fri, 22 Nov 2024 14:59:48 +0100 Subject: [PATCH 2/2] comrak: Use new `builder()` helpers --- crates/crates_io_markdown/lib.rs | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/crates/crates_io_markdown/lib.rs b/crates/crates_io_markdown/lib.rs index c884cb27ec8..7da9c63ae7c 100644 --- a/crates/crates_io_markdown/lib.rs +++ b/crates/crates_io_markdown/lib.rs @@ -71,18 +71,20 @@ impl<'a> MarkdownRenderer<'a> { ComrakRenderOptions, }; - let mut render_options = ComrakRenderOptions::default(); - // The output will be sanitized with `ammonia` - render_options.unsafe_ = true; - - let mut extension_options = ComrakExtensionOptions::default(); - extension_options.autolink = true; - extension_options.strikethrough = true; - extension_options.table = true; - extension_options.tagfilter = true; - extension_options.tasklist = true; - extension_options.header_ids = Some("user-content-".to_string()); - extension_options.footnotes = true; + let render_options = ComrakRenderOptions::builder() + // The output will be sanitized with `ammonia` + .unsafe_(true) + .build(); + + let extension_options = ComrakExtensionOptions::builder() + .autolink(true) + .strikethrough(true) + .table(true) + .tagfilter(true) + .tasklist(true) + .header_ids("user-content-".to_string()) + .footnotes(true) + .build(); let options = ComrakOptions { render: render_options,