add isEmpty method, fix #28
This commit is contained in:
@@ -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.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user