Skip to content

Commit

Permalink
SVG download: don't add namespace twice
Browse files Browse the repository at this point in the history
  • Loading branch information
quentin-st committed Jul 31, 2022
1 parent 4d53b30 commit 094558d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,10 @@ export default defineComponent({
}
// Add namespace to <svg tag
svg = svg.replace('<svg ', '<svg xmlns="http://www.w3.org/2000/svg" ');
const namespace = 'xmlns="http://www.w3.org/2000/svg"';
if (svg.indexOf(namespace) === -1) {
svg = svg.replace('<svg ', `<svg ${namespace} `);
}
const blob = new Blob([svg], {type: "image/svg+xml"});
const url = URL.createObjectURL(blob);
Expand Down

0 comments on commit 094558d

Please sign in to comment.