Implement a function to detect the end of a footnote reference definition with balanced brackets.

This commit is contained in:
Tom Alexander
2023-07-19 20:52:09 -04:00
parent 9c2eb3b122
commit 5fb66a586d
3 changed files with 86 additions and 2 deletions

View File

@@ -67,7 +67,7 @@ pub fn footnote_definition<'r, 's>(
}
#[tracing::instrument(ret, level = "debug")]
fn label<'s>(input: &'s str) -> Res<&'s str, &'s str> {
pub fn label<'s>(input: &'s str) -> Res<&'s str, &'s str> {
alt((
digit1,
take_while(|c| WORD_CONSTITUENT_CHARACTERS.contains(c) || "-_".contains(c)),