-
Notifications
You must be signed in to change notification settings - Fork 50
Open
Description
Before I begin, thank you for this awesome library.
inlineResources is not working:

This error was introduced in version 0.11.5 (issue #113, fix #116). Version 0.11.4 works fine. See screenshots below.
I suspect that fetchURL doesn't know to look in xlink:href instead of href.
Therefore element.href.baseVal is undefined and it outputs No URL passed (inline.ts, line 27)
JavaScript code used
I'm using the CDN version as recommended in #135. I've tested both versions.
async function takeSVGScreenshot(){
console.log('[IK SVG] Importing dependencies...');
const { elementToSVG, inlineResources } = await import('https://cdn.skypack.dev/[email protected]'); // or 0.11.4
console.log('[IK SVG] Taking snapshot...');
const svgDocument = elementToSVG(document.querySelector('#qtlw13'));
console.log('[IK SVG] Inlining resources...');
await inlineResources(svgDocument.documentElement); // <-- this is where the error occurs
console.log('[IK SVG] Serializing...');
const svgString = new XMLSerializer().serializeToString(svgDocument);
console.log('[IK SVG] Sending data back to server...');
callHTMLClient( '{"Sender":"TakeSVGScreenshot", "Data":"' + svgString.replace(/\"/g, '\\"') + '"}');
console.log('[IK SVG] Done');
}Metadata
Metadata
Assignees
Labels
No labels

