From 13757932af1849acaa919948e1f9b3e3587f344d Mon Sep 17 00:00:00 2001 From: hoilc Date: Tue, 28 Apr 2020 11:54:49 +0800 Subject: [PATCH] fix: simplify huxiu article (#4583) --- lib/routes/huxiu/utils.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/routes/huxiu/utils.js b/lib/routes/huxiu/utils.js index e15b69d87..bc871bc0d 100644 --- a/lib/routes/huxiu/utils.js +++ b/lib/routes/huxiu/utils.js @@ -25,6 +25,13 @@ const ProcessFeed = async (list, cache) => { .find('.text-big-title') .each((i, e) => (e.tagName = 'h3')); + $('p').each(function () { + if ($(this).find('img').length === 0 && $(this).text().match(/^\s*$/)) { + $(this).remove(); + } + }); + $('img.dialog_add_wxxy_qrcode_icon').remove(); + return { title: $('.article__title').text().trim(), description: $('.article__top-img-video') + $('.article__content').html(),