Ghost/core/client/helpers/gh-count-words.js
Jason Williams 0f17378b26 Enable JSCS checking on client.
Refs #4001
- grunt-jscs@0.8.1 which provides ES6 support.
2014-10-25 16:13:04 +00:00

14 lines
315 B
JavaScript

import counter from 'ghost/utils/word-count';
var countWords = Ember.Handlebars.makeBoundHelper(function (markdown) {
if (/^\s*$/.test(markdown)) {
return '0 words';
}
var count = counter(markdown || '');
return count + (count === 1 ? ' word' : ' words');
});
export default countWords;