docs: make all mark commands a list

This commit is contained in:
Hans Pagel
2021-10-01 23:25:07 +02:00
parent d3aa7903bd
commit 86d8ecd238
9 changed files with 179 additions and 43 deletions

View File

@@ -22,11 +22,30 @@ yarn add @tiptap/extension-highlight
| HTMLAttributes | `Object` | `{}` | Custom HTML attributes that should be added to the rendered HTML tag. |
## Commands
| Command | Options | Description |
| --------------- | ------------------ | ------------------------- |
| setHighlight | `color` (optional) | Mark text as highlighted. |
| toggleHighlight | `color` (optional) | Toggle a text highlight. |
| unsetHighlight | — | Removes the highlight. |
### setHighlight()
Mark text as highlighted.
```js
editor.commands.setHighlight()
editor.commands.setHighlight({ color: '#ffcc00' })
```
### toggleHighlight()
Toggle a text highlight.
```js
editor.commands.toggleHighlight()
editor.commands.toggleHighlight({ color: '#ffcc00' })
```
### unsetHighlight()
Removes the highlight.
```js
editor.commands. unsetHighlight()
```
## Keyboard shortcuts
| Command | Windows/Linux | macOS |