From 6d04cae27475efb0be99194fd538209a19ce0365 Mon Sep 17 00:00:00 2001 From: Ian Storm Taylor Date: Thu, 28 Sep 2017 23:04:34 -0700 Subject: [PATCH] fix html-serializer for jsdom use --- packages/slate-html-serializer/src/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/slate-html-serializer/src/index.js b/packages/slate-html-serializer/src/index.js index 11e256151..b7e689963 100644 --- a/packages/slate-html-serializer/src/index.js +++ b/packages/slate-html-serializer/src/index.js @@ -233,9 +233,10 @@ class Html { } const next = (elements) => { - if (typeof NodeList !== 'undefined' && elements instanceof NodeList) { + if (Object.prototype.toString.call(elements) == '[object NodeList]') { elements = Array.from(elements) } + switch (typeOf(elements)) { case 'array': return this.deserializeElements(elements)