From 81c0b7079f989e84c603a82e2c760cebe1691b8b Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Mon, 9 Oct 2023 15:48:43 -0400 Subject: [PATCH] Do not include leading slash in citation style. --- src/parser/citation.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/parser/citation.rs b/src/parser/citation.rs index 59421c9..7b02051 100644 --- a/src/parser/citation.rs +++ b/src/parser/citation.rs @@ -67,10 +67,13 @@ pub(crate) fn citation<'b, 'g, 'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn citestyle<'s>(input: OrgSource<'s>) -> Res, OrgSource<'s>> { - let (remaining, _) = tuple((tag("/"), style))(input)?; - let (remaining, _) = opt(tuple((tag("/"), variant)))(remaining)?; - let source = get_consumed(input, remaining); - Ok((remaining, source)) + map( + tuple(( + tag("/"), + recognize(tuple((style, opt(tuple((tag("/"), variant)))))), + )), + |(_, style)| style, + )(input) } #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))]