From d29448e3a7d3f3ae9cdbcfeae7b9c7ec4e9ee675 Mon Sep 17 00:00:00 2001 From: Zaid Abdulla Date: Wed, 4 Nov 2020 22:26:01 -0800 Subject: [PATCH] Fix parsing XML attrs with colon, equal chars --- lib/xml-parser.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/xml-parser.ts b/lib/xml-parser.ts index f54085f..ea63a48 100644 --- a/lib/xml-parser.ts +++ b/lib/xml-parser.ts @@ -104,10 +104,12 @@ export function parseAttrs(string: string): Attribute[] { continue; case CHAR_COLON: + if (state) continue; if (idx >= colonIdx) colonIdx = i; continue; case CHAR_EQUAL: + if (state) continue; if (name) throw new Error(`Unexpected character at ${i}`); name = string.slice(idx, i).trim(); // TODO validate name