mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-14 01:00:38 +08:00
fix: 异次元软件世界的标题及图片显示问题 (#2075)
This commit is contained in:
@@ -18,9 +18,11 @@ async function load(link) {
|
||||
const serverOffset = date.getTimezoneOffset() / 60;
|
||||
const pubDate = new Date(date.getTime() - 60 * 60 * 1000 * (timeZone + serverOffset)).toUTCString();
|
||||
// 提取详情
|
||||
const description = $('.entry-content').html();
|
||||
let description = $('.entry-content').html();
|
||||
// 去除data-srcset,srcset,将data-src替换成src以正常显示图片
|
||||
description = description.replace(/(data-){0,1}srcset="[\s\S]*?"/g, '');
|
||||
description = description.replace(/data-src/g, 'src');
|
||||
return { description, pubDate };
|
||||
// return { description };
|
||||
}
|
||||
|
||||
const ProcessFeed = async (list, caches) => {
|
||||
@@ -28,7 +30,7 @@ const ProcessFeed = async (list, caches) => {
|
||||
return await Promise.all(
|
||||
list.map(async (item) => {
|
||||
const $ = cheerio.load(item);
|
||||
const $title = $('a');
|
||||
const $title = $('.entry-title a');
|
||||
// 还原相对链接为绝对链接
|
||||
const itemUrl = url.resolve(host, $title.attr('href'));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user