From e655b0113b2ebb7824156491c03214fd5543cc92 Mon Sep 17 00:00:00 2001 From: FelixHeppner Date: Tue, 2 Jul 2024 22:37:55 +0200 Subject: [PATCH] Add xml version tag handling for xml files without newlines (#644) XML without line breaks is perfectly valid imho so the importer should handle that. --- src/frontend/converters/xml.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/frontend/converters/xml.ts b/src/frontend/converters/xml.ts index 8d517108..4472a9e4 100644 --- a/src/frontend/converters/xml.ts +++ b/src/frontend/converters/xml.ts @@ -178,8 +178,8 @@ function xmlParser(xml: string, removeBreaks: boolean = false) { let parser = new DOMParser() // // fix for xml files without any line breaks - // let versionText = xml.indexOf("?>") - // if (versionText > 0 && versionText < 80) xml = xml.slice(versionText, xml.length) + let versionText = xml.indexOf("?>") + if (versionText > 0 && versionText < 80) xml = xml.slice(versionText + 2, xml.length) // remove first line (standalone attribute): / while (xml.indexOf("= 0) {