fix: leetcode article image path (#2823)

This commit is contained in:
Cloud
2019-08-11 01:14:57 +08:00
committed by DIYgod
parent a18b1dbfd9
commit 842cbe1510

View File

@@ -1,6 +1,7 @@
const got = require('@/utils/got');
const cheerio = require('cheerio');
const url = require('url');
const { addNoReferrer } = require('@/utils/common-utils');
const host = 'https://leetcode.com';
@@ -42,6 +43,9 @@ module.exports = async (ctx) => {
const response = await got.get(itemUrl);
const $ = cheerio.load(response.data);
addNoReferrer($, '', 'src', itemUrl);
const description =
$('#question-preview')
.html()