From 041f3a6c4d513ba08b1879472e28864c6f96a2c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Wed, 8 May 2013 18:18:47 -0700 Subject: [PATCH] jsdom uses uppercase values for nodeName with SVG too. --- src/svg/SVGExport.js | 5 +++-- src/svg/SVGImport.js | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/svg/SVGExport.js b/src/svg/SVGExport.js index 7310d84b..18f47bf8 100644 --- a/src/svg/SVGExport.js +++ b/src/svg/SVGExport.js @@ -462,10 +462,11 @@ new function() { function exportDefinitions(node) { if (!definitions) return node; - // We can only use node nodes as defintion containers. Have the loop + // We can only use svg nodes as defintion containers. Have the loop // produce one if it's a single item of another type (when calling // #exportSVG() on an item rather than a whole project) - var container = node.nodeName == 'svg' && node, + // jsdom in Node.js uses uppercase values for nodeName... + var container = node.nodeName.toLowerCase() === 'svg' && node, firstChild = container ? container.firstChild : node; for (var i in definitions.svgs) { if (!container) { diff --git a/src/svg/SVGImport.js b/src/svg/SVGImport.js index 8aa9610c..b75a0bd1 100644 --- a/src/svg/SVGImport.js +++ b/src/svg/SVGImport.js @@ -449,7 +449,8 @@ new function() { } function importSVG(node, clearDefs) { - var type = node.nodeName, + // jsdom in Node.js uses uppercase values for nodeName... + var type = node.nodeName.toLowerCase(), importer = importers[type], item = importer && importer(node, type), data = node.getAttribute('data-paper-data');