diff --git a/utility.js b/utility.js index bf987ab..94e6839 100644 --- a/utility.js +++ b/utility.js @@ -111,7 +111,9 @@ module.exports = { .split('
').join('
').split('
').join(''); let cheerio = require('cheerio'); - let $ = cheerio.load(s); + let $ = cheerio.load(''); + let body = $('body'); + body.html(s); let a = $('img:only-child'); for (let img of Array.from(a)) { @@ -121,7 +123,7 @@ module.exports = { } } - return $.html(); + return body.html(); }; return new Promise((resolve, reject) => { if (!keys) {