jsdom uses uppercase values for nodeName with SVG too.

This commit is contained in:
Jürg Lehni 2013-05-08 18:18:47 -07:00
parent 8dbe1f4927
commit 041f3a6c4d
2 changed files with 5 additions and 3 deletions

View file

@ -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) {

View file

@ -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');