add getCharacterCount method to the editor

This commit is contained in:
Hans Pagel
2021-01-27 11:40:49 +01:00
parent 071322bfb7
commit 06b6fc25d4
2 changed files with 37 additions and 29 deletions

View File

@@ -395,6 +395,13 @@ export class Editor extends EventEmitter {
return JSON.stringify(defaultContent) === JSON.stringify(content)
}
/**
* Get the number of characters for the current document.
*/
public getCharacterCount() {
return this.state.doc.content.size - 2
}
/**
* Destroy the editor.
*/