diff --git a/src/saveSvgAsPng.js b/src/saveSvgAsPng.js index 41a36d6..6595059 100644 --- a/src/saveSvgAsPng.js +++ b/src/saveSvgAsPng.js @@ -278,7 +278,9 @@ out$.svgAsDataUri = (el, options, done) => { requireDomNode(el); const result = out$.prepareSvg(el, options) - .then(({src}) => `data:image/svg+xml;base64,${window.btoa(reEncode(doctype+src))}`); + .then(({src}) =>{ + src = src.replace(/(]+)>/, "$1 >"); + return `data:image/svg+xml;base64,${window.btoa(reEncode(doctype+src))}`}); if (typeof done === 'function') return result.then(done); return result; };