clearContent command

The clearContent command deletes the current document. The editor will maintain at least one empty paragraph due to schema requirements.

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)