RadLikeWhoa / Countable

Add live paragraph-, word- and character-counting to an HTML element.
https://sacha.me/Countable
MIT License
1.64k stars 134 forks source link

Parse whitespace html entities as spaces and treat standard blockLike… #39

Closed rawrmonstar closed 8 years ago

rawrmonstar commented 9 years ago

… HTML elements as word separators when stripTags option set.

Fixes https://github.com/RadLikeWhoa/Countable/issues/38 by replacing the html entities with their unicode equivalent.

Also parses html block elements as word separators, e.g., <div>one</div><div>two</div> counts as two words, <span>one</span><span>two</span> still counts as just one word.

RadLikeWhoa commented 8 years ago

First of all, sorry for only replying to this PR this late.

rawrmonstar commented 8 years ago

No worries. The distinction for block vs inline was to make it so tags like <em> and <strong> don't break up words since I could see something like <strong>un</strong>important. Whatever you decide is cool, my fork does the job for me. Thanks for the cool project 👍