Why TinyMCE's getContent() returns empty string if content is several space?
If my content contain only spaces, then getContent() method return empty string.
I want count up chars in TinyMCE's body.
Why TinyMCE's getContent() returns empty string if content is several space?
If my content contain only spaces, then getContent() method return empty string.
I want count up chars in TinyMCE's body.
Before TinyMCe returns the editors content this is called in Editor.js:
h = h.replace(/^\s*|\s*$/g, ''); // h is the content
This removes spaces at the beginning and end of your content, therefor your getContent() is empty when you only have spaces inserted.