fix: guardian live page (#3549)

This commit is contained in:
hoilc 2019-12-08 02:42:27 +08:00 committed by DIYgod
parent 57d0860fd9
commit 9e8e99ffec
2 changed files with 5 additions and 1 deletions

View File

@ -28,7 +28,7 @@ module.exports = async (ctx) => {
const single = {
title: item.title,
description,
description: description ? description : item.content,
pubDate: item.pubDate,
link: item.link,
};

View File

@ -4,6 +4,10 @@ const ProcessFeed = (data) => {
const $ = cheerio.load(data);
const content = $('div.content__article-body');
if (content.length === 0) {
return '';
}
// remove useless DOMs
content.find('aside, .ad-slot, .after-article, .contributions__epic, .submeta, .inline-expand-image, inline-triangle, .block-share').each((i, e) => {
$(e).remove();