From 89b8b183a0eed22909c5629a17fefa4da3bb190e Mon Sep 17 00:00:00 2001 From: xiaoqidun Date: Sat, 12 Sep 2026 01:37:09 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E5=89=8D=E7=AB=AF=E7=95=8C=E9=9D=A2):=20?= =?UTF-8?q?=E4=BC=98=E5=8C=96SVG=E8=A7=A3=E6=9E=90=E6=80=A7=E8=83=BD?= =?UTF-8?q?=EF=BC=8C=E5=87=8F=E5=B0=91=E9=A1=B5=E9=9D=A2=E5=8A=A0=E8=BD=BD?= =?UTF-8?q?=E4=B8=8E=E7=BF=BB=E9=A1=B5=E5=8D=A1=E9=A1=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/webui/ofdgo.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/assets/webui/ofdgo.js b/assets/webui/ofdgo.js index ed79501..a484de8 100644 --- a/assets/webui/ofdgo.js +++ b/assets/webui/ofdgo.js @@ -1734,12 +1734,9 @@ function layoutPageShell(shell, page) { } function parseSVG(svgText, prefix = "") { - const parsed = new DOMParser().parseFromString(svgText, "image/svg+xml"); - const error = parsed.querySelector("parsererror"); - if (error) { - throw new Error(error.textContent.trim()); - } - const svg = document.importNode(parsed.documentElement, true); + const template = document.createElement("template"); + template.innerHTML = svgText; + const svg = document.adoptNode(template.content.firstElementChild); prefixSVGIds(svg, prefix); return svg; }