Use DOMParser to handle SVG strings.

This commit is contained in:
Jürg Lehni 2013-05-09 00:22:42 -07:00
parent ee3fa3b00f
commit aa757e1d7b

View file

@ -449,6 +449,8 @@ new function() {
}
function importSVG(node, clearDefs) {
if (typeof node === 'string')
node = new DOMParser().parseFromString(node, 'image/svg+xml');
// jsdom in Node.js uses uppercase values for nodeName...
var type = node.nodeName.toLowerCase(),
importer = importers[type],