tiptap/docs/src/data/posts/commands.md

41 lines
587 B
Markdown
Raw Normal View History

2020-04-22 15:23:53 +08:00
# Commands
## .clearContent()
Clear the whole document.
## .focus()
Focus the editor at the given position.
## .insertHTML()
Insert a string of HTML at the currently selected position.
## .insertText()
Insert a string of text at the currently selected position.
## .removeMarks()
Remove all marks in the current selection.
## .selectAll()
Select the whole document.
2020-04-22 20:08:25 +08:00
## .selectParentNode()
Select the parent node.
2020-04-22 15:23:53 +08:00
## .setContent()
Replace the whole document with new content.
2020-04-22 20:08:25 +08:00
## .toggleMark()
Toggle a mark on and off.
2020-04-22 15:23:53 +08:00
## .toggleNode()
Toggle a node with another node.