fix: 修复路由xijiayi图片显示 (#8808)

Co-authored-by: yuk7-0v0 <91721784+yuk7-0v0@users.noreply.github.com>
This commit is contained in:
Yuk
2022-01-22 20:21:36 +00:00
committed by GitHub
co-authored by yuk7-0v0
parent 86c9f24d9b
commit 8ee4054e92
+9 -1
View File
@@ -36,8 +36,16 @@ module.exports = async (ctx) => {
});
const content = cheerio.load(detailResponse.data);
const post = content('.post_content');
item.description = content('.post_content').html();
post.find('img[data-original]').each((_, ele) => {
ele = $(ele);
ele.attr('src', ele.attr('data-original'));
ele.removeAttr('class');
ele.removeAttr('data-original');
});
item.description = post.html();
item.author = content('#author_baidu').text().replace('作者:', '');
item.pubDate = timezone(parseDate(content('#pubtime_baidu').text()), +8);