ckeditor
ckeditor copied to clipboard
word limit validation - account for new lines & nbsp
Description
If you have a word limit set on a CKEditor field, we need to account for the fact that the words can be split with various tags and entities like .
Currently, if you add a single word per line/paragraph, the word count will report the correct number of words, but the limit will treat them all as a single word.
To prevent that, we should first run the field value string via html_entity_decode so that things like
get converted, then insert a space between each closing and opening tag so that when we strip_tags, markup like this is treated as four words and not as a single one:
<p>one</p><p>two<br>three four</p>
Related issues
n/a