mirror of https://gitlab.com/curben/blog
fix(open_graph): skip image meta tags if post does not contain <img>
This commit is contained in:
parent
9d94a13f94
commit
711244cfdf
|
@ -66,7 +66,7 @@ function openGraphHelper (options = {}) {
|
||||||
.replace(/\n/g, ' ') // Replace new lines by spaces
|
.replace(/\n/g, ' ') // Replace new lines by spaces
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!images.length && content) {
|
if (!images.length && content && content.includes('<img')) {
|
||||||
images = images.slice()
|
images = images.slice()
|
||||||
|
|
||||||
if (!cheerio) cheerio = require('cheerio');
|
if (!cheerio) cheerio = require('cheerio');
|
||||||
|
|
Loading…
Reference in New Issue