1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-29 18:09:49 +02:00

fix html-serializer for jsdom use

This commit is contained in:
Ian Storm Taylor
2017-09-28 23:04:34 -07:00
parent c90f5f0825
commit 6d04cae274

View File

@@ -233,9 +233,10 @@ class Html {
} }
const next = (elements) => { const next = (elements) => {
if (typeof NodeList !== 'undefined' && elements instanceof NodeList) { if (Object.prototype.toString.call(elements) == '[object NodeList]') {
elements = Array.from(elements) elements = Array.from(elements)
} }
switch (typeOf(elements)) { switch (typeOf(elements)) {
case 'array': case 'array':
return this.deserializeElements(elements) return this.deserializeElements(elements)