From 3d1b7f4cc5c7502ec4c9d5b343c9fe168e38ff1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E8=BF=9B?= Date: Mon, 27 Jul 2026 16:03:57 +0800 Subject: [PATCH] =?UTF-8?q?debug:=20SVG=20=E5=A4=84=E7=90=86=E6=97=A5?= =?UTF-8?q?=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web-to-ppt/capture.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/web-to-ppt/capture.js b/web-to-ppt/capture.js index 922d33e..65fac4e 100644 --- a/web-to-ppt/capture.js +++ b/web-to-ppt/capture.js @@ -1008,13 +1008,15 @@ // SVG → 序列化为 data URL 图片 if ((element.tagName === "SVG" || element.tagName === "svg") && !node.backgroundImages.length) { + console.log('[WebToPPT] SVG found:', element.tagName, (element.className||'').slice(0,30)); try { const svgClone = element.cloneNode(true); if (!svgClone.getAttribute("xmlns")) svgClone.setAttribute("xmlns", "http://www.w3.org/2000/svg"); const svgStr = new XMLSerializer().serializeToString(svgClone); node.backgroundImages = ["data:image/svg+xml;base64," + btoa(unescape(encodeURIComponent(svgStr)))]; node.type = "RECTANGLE"; - } catch (e) { /* 静默失败 */ } + console.log('[WebToPPT] SVG captured:', node.backgroundImages[0].length, 'bytes'); + } catch (e) { console.warn('[WebToPPT] SVG failed:', e.message); } } return node;