mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-23 15:32:59 +02:00
fix(docs): correct block matching condition in Executing Commands
example (#5808)
This commit is contained in:
@@ -53,7 +53,7 @@ const App = () => {
|
|||||||
Transforms.setNodes(
|
Transforms.setNodes(
|
||||||
editor,
|
editor,
|
||||||
{ type: match ? null : 'code' },
|
{ type: match ? null : 'code' },
|
||||||
{ match: n => Editor.isBlock(editor, n) }
|
{ match: n => Element.isElement(n) && Editor.isBlock(editor, n) }
|
||||||
)
|
)
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
@@ -105,7 +105,7 @@ const CustomEditor = {
|
|||||||
Transforms.setNodes(
|
Transforms.setNodes(
|
||||||
editor,
|
editor,
|
||||||
{ type: isActive ? null : 'code' },
|
{ type: isActive ? null : 'code' },
|
||||||
{ match: n => Editor.isBlock(editor, n) }
|
{ match: n => Element.isElement(n) && Editor.isBlock(editor, n) }
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user