diff options
author | 2025-01-15 11:07:32 +0000 | |
---|---|---|
committer | 2025-01-15 11:07:32 +0000 | |
commit | a00f564deed291765a35311784096193dc3988b3 (patch) | |
tree | 7b4c73438492f96c9998cd67e35c1c0c8276fd32 | |
parent | a773e44b6139fae917e7040fabed8797bb75933c (diff) | |
parent | 440918ce535abff20dae9597f592d5dd0d1ce05c (diff) | |
download | iced-a00f564deed291765a35311784096193dc3988b3.tar.gz iced-a00f564deed291765a35311784096193dc3988b3.tar.bz2 iced-a00f564deed291765a35311784096193dc3988b3.zip |
Merge pull request #2641 from Jinderamarak/fix-markdown-nested-lists
Fix parsing of nested markdown lists without empty line
-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 d6bebb9b..c0648e9e 100644 --- a/widget/src/markdown.rs +++ b/widget/src/markdown.rs @@ -305,12 +305,21 @@ pub fn parse(markdown: &str) -> impl Iterator<Item = Item> + '_ { None } pulldown_cmark::Tag::List(first_item) if !metadata && !table => { + let prev = if spans.is_empty() { + None + } else { + produce( + &mut lists, + Item::Paragraph(Text::new(spans.drain(..).collect())), + ) + }; + lists.push(List { start: first_item, items: Vec::new(), }); - None + prev } pulldown_cmark::Tag::Item => { lists |