This patch will exlude any html entity that starts with & and ends with ; like   or é. It will also exclude tokens that start with [[{ and end with }]] that the for example media module adds.

Comments

emattias’s picture

Sorry the title is wrong. This patch doesn't make the defaults overridable.

manasiv’s picture

I verified the html entities elimination part of the patch. It works great. I have not used the token elimination patch.

OWast’s picture

Title: Don't count and html entities or tokens. Also make defaults overridable » Don't count and html entities or tokens.
Issue summary: View changes

Updating title.

OWast’s picture

Same patch as above, only removing irrelevant changes and applying against latest dev.

scott.whittaker’s picture

I had this same issue with entities increasing the count, but used the following as a much simpler patch in the ml.strip_tags function:

// decode HTML entities
input = $('<div/>').html(input).text();

It doesn't deal with media tokens though.

batje’s picture

Patch #4 works for me. But server-side the media filter (everything between [[]]) was not applied, so got an error on submitting the form.

Added 1 line that removes the content of [[ABC]] ;

(and some spaces)

asrob’s picture

Status: Needs review » Needs work

I think it doesn't work. I have a text that contains some characters (for example "Á") in full html but with this patch it doesn't count it as 1.

cedewey’s picture

Status: Needs work » Closed (won't fix)

We are putting a feature freeze on the Drupal 7 version of the module, so I'm marking this Closed, won't fix. Thank you everyone for working on this issue. If you do want to maintain the Drupal 7 version, do reach out. We'd be happy to bring you on board as a maintainer.