diff options
author | 2024-10-16 14:35:03 +0200 | |
---|---|---|
committer | 2025-01-15 10:59:20 +0000 | |
commit | 440918ce535abff20dae9597f592d5dd0d1ce05c (patch) | |
tree | 7b4c73438492f96c9998cd67e35c1c0c8276fd32 /widget | |
parent | a773e44b6139fae917e7040fabed8797bb75933c (diff) | |
download | iced-440918ce535abff20dae9597f592d5dd0d1ce05c.tar.gz iced-440918ce535abff20dae9597f592d5dd0d1ce05c.tar.bz2 iced-440918ce535abff20dae9597f592d5dd0d1ce05c.zip |
fix: parsing of nested markdown lists without empty line
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 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 |