mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-01-19 06:18:16 +01:00
Fix paste example: nested formatting (#3264)
This commit is contained in:
parent
56d798a943
commit
b629be3398
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user