mirror of https://gitlab.com/curben/blog
refactor(open_graph): arrow function
This commit is contained in:
parent
711244cfdf
commit
9f5e8de651
|
@ -72,8 +72,8 @@ function openGraphHelper (options = {}) {
|
||||||
if (!cheerio) cheerio = require('cheerio');
|
if (!cheerio) cheerio = require('cheerio');
|
||||||
const $ = cheerio.load(content)
|
const $ = cheerio.load(content)
|
||||||
|
|
||||||
$('img').each(function () {
|
$('img').each((index, element) => {
|
||||||
const src = $(this).attr('data-src')
|
const src = $(element).attr('data-src')
|
||||||
if (src) images.push(src)
|
if (src) images.push(src)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue