Skip to content

Commit 5e7faec

Browse files
committed
fix: parsing of nested markdown lists without empty line
1 parent f19bb02 commit 5e7faec

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

widget/src/markdown.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,12 +305,21 @@ pub fn parse(markdown: &str) -> impl Iterator<Item = Item> + '_ {
305305
None
306306
}
307307
pulldown_cmark::Tag::List(first_item) if !metadata && !table => {
308+
let prev = if spans.is_empty() {
309+
None
310+
} else {
311+
produce(
312+
&mut lists,
313+
Item::Paragraph(Text::new(spans.drain(..).collect())),
314+
)
315+
};
316+
308317
lists.push(List {
309318
start: first_item,
310319
items: Vec::new(),
311320
});
312321

313-
None
322+
prev
314323
}
315324
pulldown_cmark::Tag::Item => {
316325
lists

0 commit comments

Comments
 (0)