chore: merge changes from master branch

This commit is contained in:
ppoffice 2020-04-02 10:58:35 -04:00
commit 91a41e0077
2 changed files with 3 additions and 5 deletions

View File

@ -10,11 +10,6 @@
"default": "/img/favicon.svg",
"nullable": true
},
"canonical_url": {
"type": "string",
"description": "Canonical URL of the current page",
"nullable": true
},
"open_graph": {
"$ref": "/misc/open_graph.json"
},

View File

@ -8,6 +8,9 @@ const Comment = require('./comment');
* Get the word count of text.
*/
function getWordCount(content) {
if (typeof content === 'undefined') {
return 0;
}
content = content.replace(/<\/?[a-z][^>]*>/gi, '');
content = content.trim();
return content ? (content.match(/[\u00ff-\uffff]|[a-zA-Z]+/g) || []).length : 0;