1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-07-31 20:40:19 +02:00

Fix paste example: nested formatting (#3264)

This commit is contained in:
Dylan Markow
2019-12-06 16:14:35 -06:00
committed by Ian Storm Taylor
parent 56d798a943
commit b629be3398

View File

@@ -59,7 +59,9 @@ export const deserialize = el => {
parent = el.childNodes[0]
}
const children = Array.from(parent.childNodes).map(deserialize)
const children = Array.from(parent.childNodes)
.map(deserialize)
.flat()
if (el.nodeName === 'BODY') {
return jsx('fragment', {}, children)
@@ -72,7 +74,7 @@ export const deserialize = el => {
if (TEXT_TAGS[nodeName]) {
const attrs = TEXT_TAGS[nodeName](el)
return jsx('text', attrs, children)
return children.map(child => jsx('text', attrs, child))
}
return children