1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-27 00:54:22 +02:00

Doc serializing fix (#4937)

Fixing a never ending recursive function in the serializing documentation.
This commit is contained in:
Johan Davidsson
2022-04-12 17:55:26 +02:00
committed by GitHub
parent 076ab9a67a
commit d460bb42f0

View File

@@ -171,14 +171,14 @@ const deserialize = (el, markAttributes = {}) => {
const nodeAttributes = { ...markAttributes }
// define attibutes for text nodes
// define attributes for text nodes
switch (el.nodeName) {
case 'strong':
nodeAttributes.bold = true
}
const children = Array.from(el.childNodes)
.map(node => deserialize(el, nodeAttributes))
.map(node => deserialize(node, nodeAttributes))
.flat()
if (children.length === 0) {