Skip to content

Commit

Permalink
Check the word count more carefully, especially for trailing false ch…
Browse files Browse the repository at this point in the history
…aracters. Bumped to version 2.1.4

In particular, the Tags field would miscount when a trailing comma was present, making the count one more than it really was.
  • Loading branch information
danwolfgang committed Mar 21, 2014
1 parent 3b8c679 commit b2203b0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion plugins/Wordometer/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Wordometer
id: Wordometer
key: Wordometer
description: 'Within MT’s admin interface, Wordometer unobtrusively tracks the number of words in each entry field (Body, Extended, Excerpt, Keywords) and the number of tags used, as well as in text and textarea custom fields.'
version: 2.1.3
version: 2.1.4
author_name: 'Dan Wolfgang, uiNNOVATIONS'
author_link: http://uinnovations.com
plugin_link: http://www.eatdrinksleepmovabletype.com/plugins/wordometer/
Expand Down
5 changes: 4 additions & 1 deletion plugins/Wordometer/static/cms.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,10 @@ function wordCount(field, data) {
content = jQuery.trim(content);
// Finally, count the number of words.
if (content != '') {
var numWords = content.split(separator).length;
numWords = jQuery.grep(
content.split(separator),
function(n){ return(n) }
).length;
}
}

Expand Down

0 comments on commit b2203b0

Please sign in to comment.