tiptap/docs/api/commands/split-block.md

17 lines
556 B
Markdown
Raw Normal View History

2021-04-21 17:03:33 +08:00
# splitBlock
`splitBlock` will split the current node into two nodes at the current [NodeSelection](https://prosemirror.net/docs/ref/#state.NodeSelection). If the current selection is not splittable, the command will be ignored.
2021-04-21 17:03:33 +08:00
## Parameters
`options: Record<string, any>`
* `keepMarks: boolean` - Defines if the marks should be kept or removed. Defaults to `true`.
## Usage
```js
// split the current node and keep marks
editor.commands.splitBlock()
// split the current node and don't keep marks
editor.commands.splitBlock({ keepMarks: false })
```