Fix nested bolds child eating the parent exit.

This commit is contained in:
Tom Alexander
2023-04-24 16:48:33 -04:00
parent ca57c91adf
commit ed174c1c41
3 changed files with 15 additions and 12 deletions

View File

@@ -131,6 +131,12 @@ fn _text_markup_object<'r, 's, 'x>(
|(children, _exit_contents)| !children.is_empty(),
)(remaining)?;
if exit_matcher_parser(context, remaining).is_ok() {
return Err(nom::Err::Error(CustomError::MyError(MyError(
"Parent exit matcher is triggering.",
))));
}
// TODO: Sometimes its plain text, not objects
let (remaining, _close) = text_markup_end_specialized(context, remaining)?;
let (remaining, _trailing_whitespace) = space0(remaining)?;
@@ -168,6 +174,12 @@ fn _text_markup_string<'r, 's, 'x>(
|(children, _exit_contents)| !children.is_empty(),
))(remaining)?;
if exit_matcher_parser(context, remaining).is_ok() {
return Err(nom::Err::Error(CustomError::MyError(MyError(
"Parent exit matcher is triggering.",
))));
}
// TODO: Sometimes its plain text, not objects
let (remaining, _close) = text_markup_end_specialized(context, remaining)?;
let (remaining, _trailing_whitespace) = space0(remaining)?;