Skip to content

Commit

Permalink
fix: parsing of nested markdown lists without empty line
Browse files Browse the repository at this point in the history
  • Loading branch information
Jinderamarak committed Oct 16, 2024
1 parent f19bb02 commit 5e7faec
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion widget/src/markdown.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5e7faec

Please sign in to comment.