tiptap/docs/api/commands/set-mark.md

18 lines
369 B
Markdown
Raw Normal View History

2021-04-21 17:03:33 +08:00
# setMark
The `setMark` command will add a new mark at the current selection.
2021-04-21 17:03:33 +08:00
## Parameters
`typeOrName: string | MarkType`
The type of a mark to add. Can be a string or a MarkType.
`attributes: Record<string, any>`
The attributes that should be applied to the mark. **This is optional.**
## Usage
```js
editor.commands.setMark("bold", { class: 'bold-tag' })
```