aboutsummaryrefslogtreecommitdiffstats
path: root/src/xml/parsers.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/xml/parsers.rs')
-rw-r--r--src/xml/parsers.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/xml/parsers.rs b/src/xml/parsers.rs
index 3f67be7..3cbefd3 100644
--- a/src/xml/parsers.rs
+++ b/src/xml/parsers.rs
@@ -733,6 +733,23 @@ impl<'s> Parser<'s, ETag<'s>> for ETag<'s> {
}
}
+impl<'s> Parser<'s, ContentItem<'s>> for ContentItem<'s> {
+ fn parse(input: &'s str) -> IResult<&str, ContentItem<'s>> {
+ alt((
+ map(CharData::parse, |char_data| {
+ ContentItem::CharData(char_data)
+ }),
+ map(Element::parse, |element| ContentItem::Element(element)),
+ map(Reference::parse, |reference| {
+ ContentItem::Reference(reference)
+ }),
+ map(CDSect::parse, |cd_sect| ContentItem::CDSect(cd_sect)),
+ map(PI::parse, |pi| ContentItem::PI(pi)),
+ map(Comment::parse, |comment| ContentItem::Comment(comment)),
+ ))(input)
+ }
+}
+
/// [43] content ::= CharData? ((element | Reference | CDSect | PI | Comment) CharData?)*
impl<'s> Parser<'s, Content<'s>> for Content<'s> {
fn parse(input: &'s str) -> IResult<&str, Content<'s>> {