fix(open_graph): exclude svg files

This commit is contained in:
curben 2019-08-12 19:15:10 +09:30
parent 5f06b4d260
commit f58819bb3a
No known key found for this signature in database
GPG Key ID: 5D9DB57A25D34EE3
1 changed files with 1 additions and 1 deletions

View File

@ -72,7 +72,7 @@ function openGraphHelper (options = {}) {
let img
const imgPattern = /<img [^>]*src=['"]([^'"]+)([^>]*>)/gi
while ((img = imgPattern.exec(content)) !== null) {
images.push(img[1])
if (!img[1].endsWith('.svg')) images.push(img[1])
}
}