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

Feature request: ignore invisible space characters #25

Closed jurreantonisse closed 10 years ago

jurreantonisse commented 10 years ago

This is a feature request to ignore zero width space characters (http://www.fileformat.info/info/unicode/char/200b/index.htm) in the character and word count.

HTML text editors such as Redactor (http://imperavi.com/redactor/) sometimes insert zero width space characters.

I also would like to contribute by sending send a pull request but would like to discuss the functionality first.

RadLikeWhoa commented 10 years ago

This would be a rather simple test to exclude those characters, right? I don't see any harm in doing that, actually, so I think it'd be great if you could work out a PR.

RadLikeWhoa commented 10 years ago

@jurreantonisse Just asking, have you done any work on this yet? If not, I'd take it over, if that's okay with you.

jurreantonisse commented 10 years ago

@RadLikeWhoa No, not yet. My apologies. Haven't found the time. Thanks!

RadLikeWhoa commented 10 years ago

Done. Zero-width characters are ignored by default, starting with version 2.1.0 (https://github.com/RadLikeWhoa/Countable/releases/tag/v2.1.0).