mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-15 11:34:24 +03:00
0f17378b26
Refs #4001 - grunt-jscs@0.8.1 which provides ES6 support.
14 lines
315 B
JavaScript
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;
|