markdown-ppp 2.9.2

Feature-rich Markdown Parsing and Pretty-Printing library
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use crate::ast::Inline;
use nom::{
    bytes::complete::tag,
    character::complete::{alphanumeric1, char},
    combinator::map,
    sequence::delimited,
    IResult, Parser,
};

pub(crate) fn footnote_reference<'a>(input: &'a str) -> IResult<&'a str, Inline> {
    map(
        delimited(tag("[^"), alphanumeric1, char(']')),
        |s: &'a str| Inline::FootnoteReference(s.to_owned()),
    )
    .parse(input)
}