mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-12-20 14:47:50 +08:00
17 lines
369 B
Markdown
17 lines
369 B
Markdown
|
# cut
|
||
|
This command cuts out content and places it into the given position.
|
||
|
|
||
|
See also: [focus](/api/commands/cut)
|
||
|
|
||
|
## Usage
|
||
|
```js
|
||
|
const from = editor.state.selection.from
|
||
|
const to = editor.state.selection.to
|
||
|
|
||
|
const endPos = editor.state.doc.nodeSize - 2
|
||
|
|
||
|
// Cut out content from range and put it at the end of the document
|
||
|
editor.commands.cut({ from, to }, endPos)
|
||
|
```
|
||
|
|