fix: parsing of nested markdown lists without empty line

This commit is contained in:
Jinderamarak 2024-10-16 14:35:03 +02:00 committed by Héctor Ramón Jiménez
parent a773e44b61
commit 440918ce53
No known key found for this signature in database
GPG key ID: 140CC052C94F138E

View file

@ -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