mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-02-19 14:44:39 +01:00
fix example paste-html if children are empty (#4446)
Co-authored-by: Georgii Perepecho <georgii.perepecho@revolut.com>
This commit is contained in:
parent
c6203a2d68
commit
d32ce0f49b
@ -58,10 +58,14 @@ export const deserialize = el => {
|
||||
) {
|
||||
parent = el.childNodes[0]
|
||||
}
|
||||
const children = Array.from(parent.childNodes)
|
||||
let children = Array.from(parent.childNodes)
|
||||
.map(deserialize)
|
||||
.flat()
|
||||
|
||||
if (children.length === 0) {
|
||||
children = [{ text: '' }]
|
||||
}
|
||||
|
||||
if (el.nodeName === 'BODY') {
|
||||
return jsx('fragment', {}, children)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user