From 3a422e6435ebf30b1cce4618fd711b936c10e2ae Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Fri, 29 Sep 2023 14:32:41 -0400 Subject: [PATCH] Counter set always allows alphabetic values regardless of org-list-allow-alphabetical. --- src/parser/plain_list.rs | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/parser/plain_list.rs b/src/parser/plain_list.rs index f2e4313..5b55611 100644 --- a/src/parser/plain_list.rs +++ b/src/parser/plain_list.rs @@ -166,12 +166,8 @@ fn plain_list_item<'b, 'g, 'r, 's>( |(_bullet_type, bull)| Into::<&str>::into(bull) != "*" || indent_level > 0, )(remaining)?; - let (remaining, _maybe_counter_set) = opt(tuple(( - space1, - tag("[@"), - parser_with_context!(counter)(context), - tag("]"), - )))(remaining)?; + let (remaining, _maybe_counter_set) = + opt(tuple((space1, tag("[@"), counter_set_value, tag("]"))))(remaining)?; let (remaining, maybe_checkbox) = opt(tuple((space1, item_checkbox)))(remaining)?; @@ -314,6 +310,16 @@ fn counter<'b, 'g, 'r, 's>( } } +#[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] +fn counter_set_value<'s>(input: OrgSource<'s>) -> Res, OrgSource<'s>> { + alt(( + recognize(one_of( + "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", + )), + digit1, + ))(input) +} + #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn plain_list_end<'b, 'g, 'r, 's>( _context: RefContext<'b, 'g, 'r, 's>,