fix(open_graph): skip image meta tags if post does not contain <img>

This commit is contained in:
curben 2019-08-11 11:42:36 +09:30
parent 9d94a13f94
commit 711244cfdf
No known key found for this signature in database
GPG Key ID: 5D9DB57A25D34EE3
1 changed files with 1 additions and 1 deletions

View File

@ -66,7 +66,7 @@ function openGraphHelper (options = {}) {
.replace(/\n/g, ' ') // Replace new lines by spaces
}
if (!images.length && content) {
if (!images.length && content && content.includes('<img')) {
images = images.slice()
if (!cheerio) cheerio = require('cheerio');