From 2e510e9bb94428483e3c394084dae498e2919ade Mon Sep 17 00:00:00 2001 From: Menci Date: Wed, 21 Jun 2017 23:19:27 +0800 Subject: [PATCH] Fix markdown rendering return tag --- utility.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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) {