Type Editor / @type-editor/commands / set-block-type
set-block-type
Functions
| Function | Description |
|---|---|
Creates a command that converts selected textblocks to a given node type. This command factory function returns a command that attempts to change the type of all textblocks within the selection to the specified node type with the given attributes. This is commonly used for:
The command will check each textblock in the selection and only proceed if at least one block can be converted. Blocks that already have the target type and attributes are skipped. The command respects schema constraints and will only convert blocks where the parent node allows the new type. Example typescript |