diff options
author | 2025-01-30 01:46:04 +0100 | |
---|---|---|
committer | 2025-01-30 01:46:04 +0100 | |
commit | cfbeb05e32914ed951b7ce4afd131ef75b3cfb32 (patch) | |
tree | adce9db35f9a0be7ced317ba77238e8fb391b78b /widget | |
parent | 30ee9d024d00403f2fc0571946fa9ca398117e05 (diff) | |
download | iced-cfbeb05e32914ed951b7ce4afd131ef75b3cfb32.tar.gz iced-cfbeb05e32914ed951b7ce4afd131ef75b3cfb32.tar.bz2 iced-cfbeb05e32914ed951b7ce4afd131ef75b3cfb32.zip |
Fix code block merging with previous spans in `markdown` widget
Diffstat (limited to 'widget')
-rw-r--r-- | widget/src/markdown.rs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/widget/src/markdown.rs b/widget/src/markdown.rs index c0648e9e..fe61d631 100644 --- a/widget/src/markdown.rs +++ b/widget/src/markdown.rs @@ -344,7 +344,16 @@ pub fn parse(markdown: &str) -> impl Iterator<Item = Item> + '_ { })); } - None + let prev = if spans.is_empty() { + None + } else { + produce( + &mut lists, + Item::Paragraph(Text::new(spans.drain(..).collect())), + ) + }; + + prev } pulldown_cmark::Tag::MetadataBlock(_) => { metadata = true; |