mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-30 02:19:52 +02:00
Remove commands (#3351)
* remove commands in favor of editor-level functions * update examples * fix lint
This commit is contained in:
@@ -147,7 +147,7 @@ const App = () => {
|
||||
// Prevent the "`" from being inserted by default.
|
||||
event.preventDefault()
|
||||
// Otherwise, set the currently selected blocks type to "code".
|
||||
Editor.setNodes(
|
||||
Transforms.setNodes(
|
||||
editor,
|
||||
{ type: 'code' },
|
||||
{ match: n => Editor.isBlock(editor, n) }
|
||||
@@ -208,7 +208,7 @@ const App = () => {
|
||||
match: n => n.type === 'code',
|
||||
})
|
||||
// Toggle the block type depending on whether there's already a match.
|
||||
Editor.setNodes(
|
||||
Transforms.setNodes(
|
||||
editor,
|
||||
{ type: match ? 'paragraph' : 'code' },
|
||||
{ match: n => Editor.isBlock(editor, n) }
|
||||
|
Reference in New Issue
Block a user