Add a detect object function similar to the detect element function.

This commit is contained in:
Tom Alexander
2023-09-07 02:59:08 -04:00
parent ba291c6776
commit 76a81b73ac
3 changed files with 37 additions and 2 deletions

View File

@@ -7,7 +7,7 @@ use nom::combinator::recognize;
use nom::combinator::verify;
use nom::multi::many_till;
use super::object_parser::any_object_except_plain_text;
use super::object_parser::detect_any_object_except_plain_text;
use super::org_source::OrgSource;
use super::radio_link::RematchObject;
use super::util::exit_matcher_parser;
@@ -46,7 +46,9 @@ fn plain_text_end<'b, 'g, 'r, 's>(
context: RefContext<'b, 'g, 'r, 's>,
input: OrgSource<'s>,
) -> Res<OrgSource<'s>, OrgSource<'s>> {
recognize(parser_with_context!(any_object_except_plain_text)(context))(input)
recognize(parser_with_context!(detect_any_object_except_plain_text)(
context,
))(input)
}
impl<'x> RematchObject<'x> for PlainText<'x> {