mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-22 10:21:36 +03:00
0e9d4e6792
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;
|