mirror of
https://github.com/ueberdosis/tiptap.git
synced 2025-06-12 04:33:34 +08:00
add isEmpty method, fix #28
This commit is contained in:
parent
e2aa2e4bba
commit
e01a0b8484
@ -387,6 +387,13 @@ export class Editor extends EventEmitter {
|
||||
return getHtmlFromFragment(this.state.doc, this.schema)
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if there is no content.
|
||||
*/
|
||||
public isEmpty() {
|
||||
return !this.state.doc.textContent.length
|
||||
}
|
||||
|
||||
/**
|
||||
* Destroy the editor.
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user