add isEmpty method, fix #28

This commit is contained in:
Philipp Kühn 2020-10-23 14:28:25 +02:00
parent e2aa2e4bba
commit e01a0b8484

View File

@ -387,6 +387,13 @@ export class Editor extends EventEmitter {
return getHtmlFromFragment(this.state.doc, this.schema) return getHtmlFromFragment(this.state.doc, this.schema)
} }
/**
* Check if there is no content.
*/
public isEmpty() {
return !this.state.doc.textContent.length
}
/** /**
* Destroy the editor. * Destroy the editor.
*/ */