Description
In most of cases editor will have an empty paragraph on init. So getData() == ''
will be false
almost all the time. What if someone adds some spaces or new lines?
For example, you use CKE as an input to write posts or comments and you want to prevent user from submitting form until content.trim() == ''
. How to do it?
My first thought was to add an option getData( { trim: true } )
or create method isEmpty( document )
but @pjasiun and @scofalik pointed out that it won't be so easy because there is no common rule for every feature that defines when feature is empty. Eg. Can table be empty? or image?