diff --git a/web-to-ppt/capture.js b/web-to-ppt/capture.js index f894ebc..996ddbb 100644 --- a/web-to-ppt/capture.js +++ b/web-to-ppt/capture.js @@ -988,12 +988,14 @@ if ((element.tagName === "SVG" || element.tagName === "svg") && !backgroundUrls.length) { try { const svgClone = element.cloneNode(true); - // 确保有 xmlns if (!svgClone.getAttribute('xmlns')) svgClone.setAttribute('xmlns', 'http://www.w3.org/2000/svg'); const svgStr = new XMLSerializer().serializeToString(svgClone); const svgDataUrl = 'data:image/svg+xml;base64,' + btoa(unescape(encodeURIComponent(svgStr))); backgroundUrls = [svgDataUrl]; - } catch (e) { /* 静默失败 */ } + console.log('[WebToPPT] SVG captured:', (element.className || element.id || '').slice(0, 30), 'size:', svgStr.length); + } catch (e) { + console.warn('[WebToPPT] SVG capture failed:', e.message, element.tagName, (element.className || '').slice(0, 30)); + } } const type = element.tagName === "IMG" || backgroundUrls.length ? "RECTANGLE" : "FRAME";