From aa757e1d7bf1135ed748b7260e6181092ba0fb61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Thu, 9 May 2013 00:22:42 -0700 Subject: [PATCH] Use DOMParser to handle SVG strings. --- src/svg/SVGImport.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/svg/SVGImport.js b/src/svg/SVGImport.js index b75a0bd1..95cbf6e8 100644 --- a/src/svg/SVGImport.js +++ b/src/svg/SVGImport.js @@ -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],