mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-07-31 12:30:11 +02:00
Fix paste example: nested formatting (#3264)
This commit is contained in:
committed by
Ian Storm Taylor
parent
56d798a943
commit
b629be3398
@@ -59,7 +59,9 @@ export const deserialize = el => {
|
|||||||
parent = el.childNodes[0]
|
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') {
|
if (el.nodeName === 'BODY') {
|
||||||
return jsx('fragment', {}, children)
|
return jsx('fragment', {}, children)
|
||||||
@@ -72,7 +74,7 @@ export const deserialize = el => {
|
|||||||
|
|
||||||
if (TEXT_TAGS[nodeName]) {
|
if (TEXT_TAGS[nodeName]) {
|
||||||
const attrs = TEXT_TAGS[nodeName](el)
|
const attrs = TEXT_TAGS[nodeName](el)
|
||||||
return jsx('text', attrs, children)
|
return children.map(child => jsx('text', attrs, child))
|
||||||
}
|
}
|
||||||
|
|
||||||
return children
|
return children
|
||||||
|
Reference in New Issue
Block a user