Type Editor / @type-editor/commands / split-block
split-block
Type Aliases
| Type Alias | Description |
|---|---|
Function type for customizing the node type of newly split blocks. |
Variables
| Variable | Description |
|---|---|
Standard command to split the parent block at the selection. This is the default block splitting command, typically bound to the Enter key. It deletes any selected content and splits the current block, creating a new block of an appropriate type. Example typescript |
Functions
| Function | Description |
|---|---|
Creates a command that splits the parent block at the selection. This command factory creates variants of block splitting behavior, which is typically bound to the Enter key. The command handles several scenarios: Node Selection: If a block node is selected, splits before it. Text Selection: Deletes the selection content and splits the block at that point, creating a new block after the current one. The optional
If no custom function is provided, the command uses intelligent defaults:
Example typescript |