From 9964a38380a709402b741b4ef4bb4c50221ccde8 Mon Sep 17 00:00:00 2001 From: Matt <69441971+sigaloid@users.noreply.github.com> Date: Sun, 24 Oct 2021 11:33:35 -0400 Subject: [PATCH] Fixes https://github.com/johannhof/markdown.rs/issues/43 --- src/parser/block/unordered_list.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/parser/block/unordered_list.rs b/src/parser/block/unordered_list.rs index e10dfb20..b539134b 100644 --- a/src/parser/block/unordered_list.rs +++ b/src/parser/block/unordered_list.rs @@ -82,8 +82,10 @@ pub fn parse_unordered_list(lines: &[&str]) -> Option<(Block, usize)> { for c in contents { if is_paragraph || c.len() > 1 { list_contents.push(ListItem::Paragraph(c)); - } else if let Paragraph(content) = c[0].clone() { - list_contents.push(ListItem::Simple(content)); + } else if c.len() != 0 { + if let Paragraph(content) = c[0].clone() { + list_contents.push(ListItem::Simple(content)); + } } }