diff --git a/src/parser/plain_list.rs b/src/parser/plain_list.rs index 0e881e7..b728780 100644 --- a/src/parser/plain_list.rs +++ b/src/parser/plain_list.rs @@ -267,7 +267,6 @@ mod tests { #[test] fn two_blank_lines_ends_list() { - // Plain lists with an asterisk bullet must be indented or else they would be a headline let input = r#"1. foo 2. bar baz @@ -291,6 +290,31 @@ mod tests { 3. lorem +"# + ); + } + + #[test] + fn two_blank_lines_ends_nested_list() { + // Plain lists with an asterisk bullet must be indented or else they would be a headline + let input = r#"1. foo + 1. bar + + +baz"#; + let initial_context: ContextTree<'_, '_> = ContextTree::new(); + let document_context = + initial_context.with_additional_node(ContextElement::DocumentRoot(input)); + let plain_list_matcher = parser_with_context!(plain_list)(&document_context); + let (remaining, result) = + plain_list_matcher(input).expect("Should parse the plain list successfully."); + assert_eq!(remaining, "baz"); + assert_eq!( + result.get_source(), + r#"1. foo + 1. bar + + "# ); }