From 9642bc60984ffdc0ec2d8d7523c4791168a0c018 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 1 Mar 2024 03:40:21 +0000 Subject: [PATCH 1/2] chore(deps): update rust crate pulldown-cmark to 0.10 --- Cargo.lock | 13 ++++++++++--- Cargo.toml | 2 +- src/syntax_highlight.rs | 8 ++++---- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f6d7af47..3497ada0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1504,15 +1504,22 @@ dependencies = [ [[package]] name = "pulldown-cmark" -version = "0.9.3" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a1a2f1f0a7ecff9c31abbe177637be0e97a0aef46cf8738ece09327985d998" +checksum = "dce76ce678ffc8e5675b22aa1405de0b7037e2fdf8913fea40d1926c6fe1e6e7" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.4.0", "memchr", + "pulldown-cmark-escape", "unicase", ] +[[package]] +name = "pulldown-cmark-escape" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5d8f9aa0e3cbcfaf8bf00300004ee3b72f74770f9cbac93f6928771f613276b" + [[package]] name = "quick-xml" version = "0.28.2" diff --git a/Cargo.toml b/Cargo.toml index cce1a50b..fb9e74b4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -87,7 +87,7 @@ log = "0.4" env_logger = "0.11" rss = "2.0" jsonfeed = "0.2" -pulldown-cmark = {version="0.9", default-features = false} +pulldown-cmark = {version="0.10", default-features = false, features = ["html"] } engarde = { version = "0.1", path = "crates/engarde" } regex = "1.10" lazy_static = "1.4" diff --git a/src/syntax_highlight.rs b/src/syntax_highlight.rs index 4b4d3467..7087632b 100644 --- a/src/syntax_highlight.rs +++ b/src/syntax_highlight.rs @@ -141,7 +141,7 @@ impl liquid_core::ParseBlock for CodeBlockParser { } pub struct DecoratedParser<'a> { - parser: cmark::Parser<'a, 'a>, + parser: cmark::Parser<'a>, syntax: std::sync::Arc, theme: Option<&'a str>, lang: Option, @@ -150,7 +150,7 @@ pub struct DecoratedParser<'a> { impl<'a> DecoratedParser<'a> { pub fn new( - parser: cmark::Parser<'a, 'a>, + parser: cmark::Parser<'a>, syntax: std::sync::Arc, theme: Option<&'a str>, ) -> error::Result { @@ -187,7 +187,7 @@ impl<'a> Iterator for DecoratedParser<'a> { self.code = Some(vec![]); Some(Text(pulldown_cmark::CowStr::Borrowed(""))) } - Some(End(cmark::Tag::CodeBlock(_))) => { + Some(End(cmark::TagEnd::CodeBlock)) => { let html = if let Some(code) = self.code.as_deref() { let code = code.iter().join("\n"); self.syntax.format(&code, self.lang.as_deref(), self.theme) @@ -206,7 +206,7 @@ impl<'a> Iterator for DecoratedParser<'a> { } pub fn decorate_markdown<'a>( - parser: cmark::Parser<'a, 'a>, + parser: cmark::Parser<'a>, syntax: std::sync::Arc, theme_name: Option<&'a str>, ) -> error::Result> { From 920fb01f996ce2eb47c1eec9a22ff9e6a7bf7efd Mon Sep 17 00:00:00 2001 From: Ed Page Date: Fri, 1 Mar 2024 09:23:48 -0600 Subject: [PATCH 2/2] test: Update snapshots --- tests/cmd/errors.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/cmd/errors.md b/tests/cmd/errors.md index d668f8c8..fd37e4cb 100644 --- a/tests/cmd/errors.md +++ b/tests/cmd/errors.md @@ -17,8 +17,8 @@ Commands: help Print this message or the help of the given subcommand(s) Options: - -v, --verbose... More output per occurrence - -q, --quiet... Less output per occurrence + -v, --verbose... Increase logging verbosity + -q, --quiet... Decrease logging verbosity --color Controls when to use color [default: auto] [possible values: auto, always, never] -h, --help Print help