From 3d8fe253c91f38a7ee69b159dd50ba7c55ed57ff Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Mon, 27 Mar 2023 18:22:08 -0400 Subject: [PATCH] Check for exit matcher between elements in a plain list item. --- src/parser/parser_context.rs | 1 + src/parser/plain_list.rs | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/parser/parser_context.rs b/src/parser/parser_context.rs index df39b3b..445884a 100644 --- a/src/parser/parser_context.rs +++ b/src/parser/parser_context.rs @@ -55,6 +55,7 @@ impl<'r, 's> ContextTree<'r, 's> { self.tree.into_iter_until(&other.tree) } + #[tracing::instrument(ret, level = "debug")] pub fn check_exit_matcher( &'r self, i: &'s str, diff --git a/src/parser/plain_list.rs b/src/parser/plain_list.rs index 08cf419..9e46121 100644 --- a/src/parser/plain_list.rs +++ b/src/parser/plain_list.rs @@ -57,8 +57,10 @@ pub fn plain_list_item<'r, 's>( .with_additional_node(ContextElement::ListItem(indent_level)); let element_matcher = parser_with_context!(element)(&parser_context); + let exit_matcher = parser_with_context!(exit_matcher_parser)(&parser_context); let (remaining, (bull, _ws)) = tuple((bullet, space0))(remaining)?; - let (remaining, contents) = many0(element_matcher)(remaining)?; + let (remaining, (contents, _exit_contents)) = + many_till(element_matcher, exit_matcher)(remaining)?; let source = get_consumed(input, remaining); Ok((