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:
@@ -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) }
|
||||
)
|
||||
},
|
||||
}
|
||||
|
Reference in New Issue
Block a user