Merge pull request #2641 from Jinderamarak/fix-markdown-nested-lists
Fix parsing of nested markdown lists without empty line
This commit is contained in:
commit
a00f564dee
1 changed files with 10 additions and 1 deletions
|
|
@ -305,12 +305,21 @@ pub fn parse(markdown: &str) -> impl Iterator<Item = Item> + '_ {
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
pulldown_cmark::Tag::List(first_item) if !metadata && !table => {
|
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 {
|
lists.push(List {
|
||||||
start: first_item,
|
start: first_item,
|
||||||
items: Vec::new(),
|
items: Vec::new(),
|
||||||
});
|
});
|
||||||
|
|
||||||
None
|
prev
|
||||||
}
|
}
|
||||||
pulldown_cmark::Tag::Item => {
|
pulldown_cmark::Tag::Item => {
|
||||||
lists
|
lists
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue