Fix nested bolds child eating the parent exit.
This commit is contained in:
parent
ca57c91adf
commit
ed174c1c41
3
org_mode_samples/text_markup/deep_nesting.org
Normal file
3
org_mode_samples/text_markup/deep_nesting.org
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
foo *bar /baz *lorem* ipsum/ dolar* alpha
|
||||||
|
|
||||||
|
foo *bar /baz _lorem_ ipsum/ dolar* alpha
|
@ -131,6 +131,12 @@ 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(
|
||||||
|
"Parent exit matcher is triggering.",
|
||||||
|
))));
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: Sometimes its plain text, not objects
|
// TODO: Sometimes its plain text, not objects
|
||||||
let (remaining, _close) = text_markup_end_specialized(context, remaining)?;
|
let (remaining, _close) = text_markup_end_specialized(context, remaining)?;
|
||||||
let (remaining, _trailing_whitespace) = space0(remaining)?;
|
let (remaining, _trailing_whitespace) = space0(remaining)?;
|
||||||
@ -168,6 +174,12 @@ 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(
|
||||||
|
"Parent exit matcher is triggering.",
|
||||||
|
))));
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: Sometimes its plain text, not objects
|
// TODO: Sometimes its plain text, not objects
|
||||||
let (remaining, _close) = text_markup_end_specialized(context, remaining)?;
|
let (remaining, _close) = text_markup_end_specialized(context, remaining)?;
|
||||||
let (remaining, _trailing_whitespace) = space0(remaining)?;
|
let (remaining, _trailing_whitespace) = space0(remaining)?;
|
||||||
|
@ -1,13 +1 @@
|
|||||||
prologue *goes here* I guess *bold
|
|
||||||
text*
|
|
||||||
|
|
||||||
bold*wont* start *or stop*when there is text outside it
|
|
||||||
|
|
||||||
I guess *regular
|
|
||||||
|
|
||||||
text*
|
|
||||||
|
|
||||||
[[foo][foo *bar]] baz* car
|
|
||||||
|
|
||||||
|
|
||||||
*nesting *bold entrances* and* exits
|
*nesting *bold entrances* and* exits
|
||||||
|
Loading…
x
Reference in New Issue
Block a user