From 14653c1396f7a1a0d6b9c14ad5b783a1718bc5ab Mon Sep 17 00:00:00 2001 From: Astro Date: Fri, 25 Mar 2022 02:14:43 +0100 Subject: [PATCH] minidom: never parse literal angle brackets as text or attribute value --- minidom/src/token.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/minidom/src/token.rs b/minidom/src/token.rs index 9699c50..6408508 100644 --- a/minidom/src/token.rs +++ b/minidom/src/token.rs @@ -218,7 +218,12 @@ impl Token { Ok((s, Cow::from(format!("{}", c)))) }, |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::normalize_newlines(text); Ok((s, text))