summaryrefslogtreecommitdiffstats
path: root/widget
diff options
context:
space:
mode:
authorLibravatar Jinderamarak <47433483+Jinderamarak@users.noreply.github.com>2024-10-16 14:35:03 +0200
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2025-01-15 10:59:20 +0000
commit440918ce535abff20dae9597f592d5dd0d1ce05c (patch)
tree7b4c73438492f96c9998cd67e35c1c0c8276fd32 /widget
parenta773e44b6139fae917e7040fabed8797bb75933c (diff)
downloadiced-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.rs11
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