Plain tag parsing
This commit is contained in:
parent
7c8e65f556
commit
a6ee6bfbde
|
@ -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>> {
|
||||
self.tag_delimited(
|
||||
"<small>",
|
||||
|
|
Loading…
Reference in New Issue