mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-28 09:29:49 +02:00
Doc serializing fix (#4937)
Fixing a never ending recursive function in the serializing documentation.
This commit is contained in:
@@ -171,14 +171,14 @@ const deserialize = (el, markAttributes = {}) => {
|
|||||||
|
|
||||||
const nodeAttributes = { ...markAttributes }
|
const nodeAttributes = { ...markAttributes }
|
||||||
|
|
||||||
// define attibutes for text nodes
|
// define attributes for text nodes
|
||||||
switch (el.nodeName) {
|
switch (el.nodeName) {
|
||||||
case 'strong':
|
case 'strong':
|
||||||
nodeAttributes.bold = true
|
nodeAttributes.bold = true
|
||||||
}
|
}
|
||||||
|
|
||||||
const children = Array.from(el.childNodes)
|
const children = Array.from(el.childNodes)
|
||||||
.map(node => deserialize(el, nodeAttributes))
|
.map(node => deserialize(node, nodeAttributes))
|
||||||
.flat()
|
.flat()
|
||||||
|
|
||||||
if (children.length === 0) {
|
if (children.length === 0) {
|
||||||
|
Reference in New Issue
Block a user