1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-22 23:12:52 +02:00

fix(docs): correct block matching condition in Executing Commands example (#5808)

This commit is contained in:
jerry-lllman
2025-03-11 00:21:29 +08:00
committed by GitHub
parent 4f992cff5c
commit 1022682d82

View File

@@ -53,7 +53,7 @@ const App = () => {
Transforms.setNodes(
editor,
{ type: match ? null : 'code' },
{ match: n => Editor.isBlock(editor, n) }
{ match: n => Element.isElement(n) && Editor.isBlock(editor, n) }
)
break
}
@@ -105,7 +105,7 @@ const CustomEditor = {
Transforms.setNodes(
editor,
{ type: isActive ? null : 'code' },
{ match: n => Editor.isBlock(editor, n) }
{ match: n => Element.isElement(n) && Editor.isBlock(editor, n) }
)
},
}