From a91dbe5021d13dc16641c840c27abd67f7027a54 Mon Sep 17 00:00:00 2001 From: Zaid Abdulla Date: Wed, 4 Nov 2020 22:21:10 -0800 Subject: [PATCH] Handle multi-line XML declaration --- lib/xml-parser.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/xml-parser.ts b/lib/xml-parser.ts index 6e6ebff..f54085f 100644 --- a/lib/xml-parser.ts +++ b/lib/xml-parser.ts @@ -57,9 +57,9 @@ export function parseXmlDeclaration(buffer: Buffer): Attribute[] { for (const enc of encodings) { let str = buffer.toString(enc, 0, 150); if (str.startsWith("")); try { - return parseAttrs(str.slice(5, -2)); + return parseAttrs(str.slice(5)); } catch (err) { // Ignore }