Switch to using with_additional_fail_matcher.

This commit is contained in:
Tom Alexander 2022-07-17 18:22:40 -04:00
parent cad8f4bd77
commit e5af567981
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE
1 changed files with 3 additions and 5 deletions

View File

@ -60,11 +60,9 @@ where
F: Clone,
{
not(&mut context.fail_matcher)(i)?;
let mut old_fail_matcher_clone = context.fail_matcher.clone();
let mut new_context =
NomContext::new(move |i| alt((recognize(bold_end), &mut old_fail_matcher_clone))(i));
new_context.can_match_bold = context.can_match_bold;
new_context.can_match_link = context.can_match_link;
let new_context = context
.without_bold()
.with_additional_fail_matcher(|i| recognize(bold_end)(i));
let text_element_parser = parser_with_context!(flat_text_element)(new_context);
map(
recognize(tuple((