Skip to content

Commit

Permalink
chore: merge changes from master branch
Browse files Browse the repository at this point in the history
  • Loading branch information
ppoffice committed Apr 2, 2020
2 parents acde2ef + 30f33e9 commit 91a41e0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
5 changes: 0 additions & 5 deletions include/schema/common/head.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
3 changes: 3 additions & 0 deletions layout/common/article.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 91a41e0

Please sign in to comment.