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;