diff --git a/lib/single-file/single-file-core.js b/lib/single-file/single-file-core.js index 07eb09631..a9dff2ae2 100644 --- a/lib/single-file/single-file-core.js +++ b/lib/single-file/single-file-core.js @@ -1911,8 +1911,8 @@ class ProcessorHelper { if (testValidURL(resourceURL)) { let svgDoc; if (!originalResourceURL.startsWith(baseURI + "#")) { - const content = await batchRequest.addURL(resourceURL); - svgDoc = util.parseSVGContent(content); + const response = await batchRequest.addURL(resourceURL); + svgDoc = util.parseSVGContent(response.content); } else { svgDoc = doc; } diff --git a/lib/single-file/single-file-util.js b/lib/single-file/single-file-util.js index 404cda8db..946d208ab 100644 --- a/lib/single-file/single-file-util.js +++ b/lib/single-file/single-file-util.js @@ -97,6 +97,8 @@ function getInstance(utilOptions) { const doc = (new DOMParser()).parseFromString(content, "image/svg+xml"); if (doc.querySelector("parsererror")) { return (new DOMParser()).parseFromString(content, "text/html"); + } else { + return doc; } }, async digest(algo, text) {