mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-10 09:13:59 +02:00
This reverts commit 0ca31e7498
.
This commit is contained in:
@@ -1,5 +0,0 @@
|
|||||||
---
|
|
||||||
'slate': patch
|
|
||||||
---
|
|
||||||
|
|
||||||
Warn when normalization removes node
|
|
@@ -227,14 +227,6 @@ export const createEditor = (): Editor => {
|
|||||||
// other inline nodes, or parent blocks that only contain inlines and
|
// other inline nodes, or parent blocks that only contain inlines and
|
||||||
// text.
|
// text.
|
||||||
if (isInlineOrText !== shouldHaveInlines) {
|
if (isInlineOrText !== shouldHaveInlines) {
|
||||||
// eslint-disable-next-line no-console
|
|
||||||
console.warn(
|
|
||||||
`Removing ${
|
|
||||||
isInlineOrText ? 'inline' : 'block'
|
|
||||||
} node at path ${path.concat(n)} because parent expects ${
|
|
||||||
shouldHaveInlines ? 'inline' : 'block'
|
|
||||||
} children`
|
|
||||||
)
|
|
||||||
Transforms.removeNodes(editor, { at: path.concat(n), voids: true })
|
Transforms.removeNodes(editor, { at: path.concat(n), voids: true })
|
||||||
n--
|
n--
|
||||||
} else if (Element.isElement(child)) {
|
} else if (Element.isElement(child)) {
|
||||||
|
Reference in New Issue
Block a user