Editor: restructure word count

* The WordCounter should only do one thing: count words. This makes it also easier to test.
* Add some really basic unit tests.
* Instead of only refreshing the count on enter and delete, refresh the count when the user stops typing. Also look at paste and content changes in TinyMCE.
* Use `match` instead of `replace` when it is appropriate.
* More readable code.

See #30966. Fixes #26620.


Built from https://develop.svn.wordpress.org/trunk@32856


git-svn-id: http://core.svn.wordpress.org/trunk@32827 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Ella Iseulde Van Dorpe
2015-06-19 10:35:26 +00:00
parent 50e32a1969
commit fd95002b2a
9 changed files with 92 additions and 84 deletions

File diff suppressed because one or more lines are too long