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.
|
|
|
|
|
2020-04-22 20:22:31 +08:00
|
|
|
## .removeMark()
|
|
|
|
|
|
|
|
Remove a mark in the current selection.
|
|
|
|
|
2020-04-22 15:23:53 +08:00
|
|
|
## .removeMarks()
|
|
|
|
|
|
|
|
Remove all marks in the current selection.
|
|
|
|
|
2020-04-22 20:38:15 +08:00
|
|
|
## .replaceWithNode()
|
|
|
|
|
|
|
|
Replace a given range with a node.
|
|
|
|
|
2020-04-22 15:23:53 +08:00
|
|
|
## .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.
|