Updated: Comment #N
Problem/Motivation
The word count currently drops some (natural language) punctuation characters and then counts what is left.
With HTML being a very popular case, the word count is a crazy amount more than the real content words.
We have started to mask HTML, but it's experimental and will be rebuilt from scratch cleanly / pluggable as learned from that try.
Thus, we need a quickfix.
Proposed resolution
Extend the current word count function tmgmt_word_count() with a html strip_tags().
The side effect is that it also drops attributes (like alt= and title=) that need translation. But our masking is also a bit limited with those cases.
This should be the default, but with the possibility to disable. Use a variable like
if (variable_get('tmgmt_word_count_html', TRUE)) { ...
Remaining tasks
Document limitations clearly.
User interface changes
-
API changes
New setting tmgmt_word_count_html
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | 2173071-fiter_html_word_count-1.patch | 2.01 KB | blueminds |
Comments
Comment #1
blueminds commentedPlease see the patch
Comment #2
miro_dietikerPerfect, including test coverage. :-)
Fixed.