diff --git a/src/parser/keyword.rs b/src/parser/keyword.rs index cdb1e1f..f115fba 100644 --- a/src/parser/keyword.rs +++ b/src/parser/keyword.rs @@ -2,6 +2,7 @@ use nom::branch::alt; use nom::bytes::complete::is_not; use nom::bytes::complete::tag; use nom::bytes::complete::tag_no_case; +use nom::bytes::complete::take_while1; use nom::character::complete::anychar; use nom::character::complete::line_ending; use nom::character::complete::space0; @@ -83,6 +84,7 @@ fn affiliated_key<'s>(input: OrgSource<'s>) -> Res, OrgSource<'s>> alt(( recognize(tuple((dual_affiliated_key, tag("["), optval, tag("]")))), plain_affiliated_key, + export_keyword ))(input) } @@ -153,3 +155,8 @@ fn _optval_end<'s>( } tag("\n")(input) } + +#[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] +fn export_keyword<'s>(input: OrgSource<'s>) -> Res, OrgSource<'s>> { + recognize(tuple((tag_no_case("attr_"), take_while1(|c: char| c.is_alphanumeric() || "-_".contains(c)))))(input) +}