Exit text markup if the parent exit matcher is triggering.
This commit is contained in:
parent
ed174c1c41
commit
90a47b7b49
@ -12,6 +12,7 @@ use nom::combinator::recognize;
|
||||
use nom::combinator::verify;
|
||||
use nom::multi::many_till;
|
||||
use nom::sequence::terminated;
|
||||
use tracing::span;
|
||||
|
||||
use super::Context;
|
||||
use crate::error::CustomError;
|
||||
@ -131,11 +132,15 @@ fn _text_markup_object<'r, 's, 'x>(
|
||||
|(children, _exit_contents)| !children.is_empty(),
|
||||
)(remaining)?;
|
||||
|
||||
{
|
||||
let span = span!(tracing::Level::DEBUG, "Checking parent exit.");
|
||||
let _enter = span.enter();
|
||||
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)?;
|
||||
@ -174,11 +179,15 @@ fn _text_markup_string<'r, 's, 'x>(
|
||||
|(children, _exit_contents)| !children.is_empty(),
|
||||
))(remaining)?;
|
||||
|
||||
{
|
||||
let span = span!(tracing::Level::DEBUG, "Checking parent exit.");
|
||||
let _enter = span.enter();
|
||||
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)?;
|
||||
|
@ -1 +1,3 @@
|
||||
*nesting *bold entrances* and* exits
|
||||
foo *bar /baz *lorem* ipsum/ dolar* alpha
|
||||
|
||||
foo *bar /baz _lorem_ ipsum/ dolar* alpha
|
||||
|
Loading…
Reference in New Issue
Block a user