Upgrade pulldown-cmark from 0.9 to 0.10

This commit is contained in:
Jonas Platte 2024-04-28 22:50:39 +02:00
parent c3e282b441
commit 2a6d31a023
No known key found for this signature in database
GPG Key ID: 7D261D771D915378
2 changed files with 3 additions and 3 deletions

View File

@ -62,7 +62,7 @@ indexmap = { version = "2.0.0", features = ["serde"] }
js_int = { workspace = true, features = ["serde"] }
js_option = "0.1.0"
percent-encoding = "2.1.0"
pulldown-cmark = { version = "0.9.1", default-features = false, optional = true }
pulldown-cmark = { version = "0.10.3", optional = true, default-features = false, features = ["html"] }
regex = { version = "1.5.6", default-features = false, features = ["std", "perf"] }
ruma-common = { workspace = true }
ruma-html = { workspace = true, optional = true }

View File

@ -894,7 +894,7 @@ pub struct CustomEventContent {
#[cfg(feature = "markdown")]
pub(crate) fn parse_markdown(text: &str) -> Option<String> {
use pulldown_cmark::{Event, Options, Parser, Tag};
use pulldown_cmark::{Event, Options, Parser, Tag, TagEnd};
const OPTIONS: Options = Options::ENABLE_TABLES.union(Options::ENABLE_STRIKETHROUGH);
@ -919,7 +919,7 @@ pub(crate) fn parse_markdown(text: &str) -> Option<String> {
} else {
false
};
let is_paragraph_end = matches!(event, Event::End(Tag::Paragraph));
let is_paragraph_end = matches!(event, Event::End(TagEnd::Paragraph));
!is_text && !is_break && !is_first_paragraph_start && !is_paragraph_end
});