Handle Cdata tokens

This commit is contained in:
Josh Taylor 2023-10-18 16:27:12 -07:00
parent c89afc2553
commit 03d83298b5
1 changed files with 3 additions and 0 deletions

View File

@ -333,6 +333,9 @@ impl<'xml> Iterator for Context<'xml> {
Ok(Token::Text { text }) => { Ok(Token::Text { text }) => {
return Some(Ok(Node::Text(text.as_str()))); return Some(Ok(Node::Text(text.as_str())));
} }
Ok(Token::Cdata { text, .. }) => {
return Some(Ok(Node::Text(text.as_str())));
}
Ok(Token::Declaration { .. }) => match self.stack.is_empty() { Ok(Token::Declaration { .. }) => match self.stack.is_empty() {
false => return Some(Err(Error::UnexpectedToken(format!("{token:?}")))), false => return Some(Err(Error::UnexpectedToken(format!("{token:?}")))),
true => {} true => {}