From 602cf4c374766ccdf2417cb7cf34b3305bc97d89 Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Fri, 31 Mar 2023 09:54:48 -0400 Subject: [PATCH] Removing regurgitate calls. This hacky solution ends up with whitespace getting captured twice so I will need to either use context or a separate parser. --- src/parser/plain_list.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/parser/plain_list.rs b/src/parser/plain_list.rs index 453ba2c..c3d50db 100644 --- a/src/parser/plain_list.rs +++ b/src/parser/plain_list.rs @@ -63,11 +63,8 @@ pub fn plain_list_item<'r, 's>( 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, _exit_contents)) = many_till(element_matcher, |i| { - let with_whitespace_added_back = regurgitate(input, i); - exit_matcher(with_whitespace_added_back) - })(remaining)?; - let remaining = regurgitate(input, remaining); + let (remaining, (contents, _exit_contents)) = + many_till(element_matcher, exit_matcher)(remaining)?; let source = get_consumed(input, remaining); Ok((