Apply a similar optimization to the detect element parser but also unify detection of affiliated keywords.
This commit is contained in:
@@ -89,17 +89,24 @@ fn fixed_width_area_line<'b, 'g, 'r, 's>(
|
||||
Ok((remaining, value))
|
||||
}
|
||||
|
||||
#[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))]
|
||||
pub(crate) fn detect_fixed_width_area<'b, 'g, 'r, 's>(
|
||||
#[cfg_attr(
|
||||
feature = "tracing",
|
||||
tracing::instrument(ret, level = "debug", skip(context, affiliated_keywords))
|
||||
)]
|
||||
pub(crate) fn detect_fixed_width_area<'b, 'g, 'r, 's, AK>(
|
||||
affiliated_keywords: AK,
|
||||
remaining: OrgSource<'s>,
|
||||
context: RefContext<'b, 'g, 'r, 's>,
|
||||
input: OrgSource<'s>,
|
||||
) -> Res<OrgSource<'s>, ()> {
|
||||
let (input, _) = many0(parser_with_context!(affiliated_keyword)(context))(input)?;
|
||||
) -> Res<OrgSource<'s>, ()>
|
||||
where
|
||||
AK: IntoIterator<Item = Keyword<'s>>,
|
||||
{
|
||||
tuple((
|
||||
start_of_line,
|
||||
space0,
|
||||
tag(":"),
|
||||
alt((tag(" "), org_line_ending)),
|
||||
))(input)?;
|
||||
))(remaining)?;
|
||||
Ok((input, ()))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user