Skip to content

Commit

Permalink
issue caused by safari use tag ns1 (exupero#121)
Browse files Browse the repository at this point in the history
replace ns1 with xmlns:xlink="http://www.w3.org/1999/xlink

Fixes exupero#91.
  • Loading branch information
guaizi149 authored and exupero committed Nov 23, 2016
1 parent bf057e4 commit 3478b86
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion saveSvgAsPng.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,9 @@
clone.insertBefore(defs, clone.firstChild);

if (cb) {
cb(outer.innerHTML, width, height);
var outHtml = outer.innerHTML;
outHtml = outHtml.replace(/NS\d+:href/gi, 'xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href');
cb(outHtml, width, height);
}
});
}
Expand Down

0 comments on commit 3478b86

Please sign in to comment.