Add support for empty lesser blocks.
This commit is contained in:
@@ -8,7 +8,6 @@ use nom::combinator::not;
|
||||
use nom::combinator::opt;
|
||||
use nom::combinator::peek;
|
||||
use nom::combinator::recognize;
|
||||
use nom::combinator::verify;
|
||||
use nom::multi::many0;
|
||||
use nom::multi::many_till;
|
||||
use nom::sequence::tuple;
|
||||
@@ -160,9 +159,9 @@ pub fn text_until_exit<'b, 'g, 'r, 's>(
|
||||
context: RefContext<'b, 'g, 'r, 's>,
|
||||
input: OrgSource<'s>,
|
||||
) -> Res<OrgSource<'s>, OrgSource<'s>> {
|
||||
recognize(verify(
|
||||
many_till(anychar, parser_with_context!(exit_matcher_parser)(context)),
|
||||
|(children, _exit_contents)| !children.is_empty(),
|
||||
recognize(many_till(
|
||||
anychar,
|
||||
parser_with_context!(exit_matcher_parser)(context),
|
||||
))(input)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user