minidom: never parse literal angle brackets as text or attribute value

This commit is contained in:
Astro 2022-03-25 02:14:43 +01:00
parent ecd21eeee5
commit 14653c1396

View file

@ -218,7 +218,12 @@ impl Token {
Ok((s, Cow::from(format!("{}", c)))) Ok((s, Cow::from(format!("{}", c))))
}, |s| { }, |s| {
let (s, _) = not(peek(char(until)))(s)?; let (s, _) = not(peek(char(until)))(s)?;
let (s, text) = take_while1(|b| b != until as u8 && b != b'&')(s)?; let (s, text) = take_while1(|b|
b != until as u8 &&
b != b'&' &&
b != b'<' &&
b != b'>'
)(s)?;
let text = Self::str_from_utf8(text)?; let text = Self::str_from_utf8(text)?;
let text = Self::normalize_newlines(text); let text = Self::normalize_newlines(text);
Ok((s, text)) Ok((s, text))