From 85454a0a273b9221d5863a824c23a15e5e2e9dd5 Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Fri, 15 Sep 2023 21:14:12 -0400 Subject: [PATCH] Fix footnote reference function label matcher. Previously when a label started with a number but contained other characters, this parser would fail because it would not match the entire label. --- src/parser/footnote_definition.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/parser/footnote_definition.rs b/src/parser/footnote_definition.rs index a3446975..75bb3ef6 100644 --- a/src/parser/footnote_definition.rs +++ b/src/parser/footnote_definition.rs @@ -2,7 +2,6 @@ use nom::branch::alt; use nom::bytes::complete::tag; use nom::bytes::complete::tag_no_case; use nom::bytes::complete::take_while; -use nom::character::complete::digit1; use nom::character::complete::space0; use nom::combinator::opt; use nom::combinator::recognize; @@ -94,10 +93,7 @@ pub(crate) fn footnote_definition<'b, 'g, 'r, 's>( #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] pub(crate) fn label<'s>(input: OrgSource<'s>) -> Res, OrgSource<'s>> { - alt(( - digit1, - take_while(|c| WORD_CONSTITUENT_CHARACTERS.contains(c) || "-_".contains(c)), - ))(input) + take_while(|c| WORD_CONSTITUENT_CHARACTERS.contains(c) || "-_".contains(c))(input) } #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))]