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::combinator::verify;
|
||||||
use nom::multi::many_till;
|
use nom::multi::many_till;
|
||||||
use nom::sequence::terminated;
|
use nom::sequence::terminated;
|
||||||
|
use tracing::span;
|
||||||
|
|
||||||
use super::Context;
|
use super::Context;
|
||||||
use crate::error::CustomError;
|
use crate::error::CustomError;
|
||||||
@ -131,10 +132,14 @@ fn _text_markup_object<'r, 's, 'x>(
|
|||||||
|(children, _exit_contents)| !children.is_empty(),
|
|(children, _exit_contents)| !children.is_empty(),
|
||||||
)(remaining)?;
|
)(remaining)?;
|
||||||
|
|
||||||
if exit_matcher_parser(context, remaining).is_ok() {
|
{
|
||||||
return Err(nom::Err::Error(CustomError::MyError(MyError(
|
let span = span!(tracing::Level::DEBUG, "Checking parent exit.");
|
||||||
"Parent exit matcher is triggering.",
|
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
|
// TODO: Sometimes its plain text, not objects
|
||||||
@ -174,10 +179,14 @@ fn _text_markup_string<'r, 's, 'x>(
|
|||||||
|(children, _exit_contents)| !children.is_empty(),
|
|(children, _exit_contents)| !children.is_empty(),
|
||||||
))(remaining)?;
|
))(remaining)?;
|
||||||
|
|
||||||
if exit_matcher_parser(context, remaining).is_ok() {
|
{
|
||||||
return Err(nom::Err::Error(CustomError::MyError(MyError(
|
let span = span!(tracing::Level::DEBUG, "Checking parent exit.");
|
||||||
"Parent exit matcher is triggering.",
|
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
|
// TODO: Sometimes its plain text, not objects
|
||||||
|
@ -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