Plain tag parsing

This commit is contained in:
Natty 2023-10-05 22:12:51 +02:00
parent 7c8e65f556
commit a6ee6bfbde
Signed by: natty
GPG Key ID: BF6CB659ADEE60EC
1 changed files with 14 additions and 0 deletions

View File

@ -453,6 +453,20 @@ impl Context {
)) ))
} }
fn tag_plain<'a>(&self, input: Span<'a>) -> IResult<Span<'a>, Token<'a>> {
let opening_tag = &tag("<small>");
let closing_tag = &tag("</small>");
let (input, _) = opening_tag(input)?;
let (input, text) = map(
recognize(many1(tuple((not_line_ending, not(closing_tag))))),
Span::into_fragment,
)(input)?;
let (input, _) = closing_tag(input)?;
Ok((input, Token::PlainTag(text.into())))
}
fn tag_small<'a>(&self, input: Span<'a>) -> IResult<Span<'a>, Token<'a>> { fn tag_small<'a>(&self, input: Span<'a>) -> IResult<Span<'a>, Token<'a>> {
self.tag_delimited( self.tag_delimited(
"<small>", "<small>",