From 50843d8f873e5c0b5faebe0512bc5304dfdd84c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Sun, 31 Jan 2016 22:47:57 +0100 Subject: [PATCH] Node: Switch to jsdom v8.0.1 with patched-in image support. And fix XMLSerializer#serializeToString() to work with it. --- package.json | 2 +- src/node/window.js | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 104e4242..ea8368b2 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "node": ">=0.10.0 <6.0.0" }, "dependencies": { - "jsdom": "git://github.com/lehni/jsdom.git#3d55789d0f4d55392721b1e22890837fde472375", + "jsdom": "git://github.com/lehni/jsdom.git#bd86dd16666241edd5f25bc4f4e144f24da3c889", "source-map-support": "^0.4.0" }, "optionalDependencies": { diff --git a/src/node/window.js b/src/node/window.js index a3e58f9c..be7010fd 100644 --- a/src/node/window.js +++ b/src/node/window.js @@ -32,7 +32,9 @@ function XMLSerializer() { } XMLSerializer.prototype.serializeToString = function(node) { - var text = jsdom.serializeDocument(node); + if (!node) + return ''; + var text = node.outerHTML; // Fix a jsdom issue where all SVG tagNames are lowercased: // https://github.com/tmpvar/jsdom/issues/620 var tagNames = ['linearGradient', 'radialGradient', 'clipPath', 'textPath'];