clearContent command
The clearContent command deletes the current document. The editor will retain enough content to satisfy its schema, such as an empty paragraph when using StarterKit with its default settings.
See also: setContent, insertContent
Parameters
emitUpdate?: boolean (true)
Whether to emit an update event. Defaults to true (Note: This changed from false in v2).
Examples
// Clear content (emits update event by default)
editor.commands.clearContent()
// Clear content without emitting update
editor.commands.clearContent(false)