diff --git a/lib/v2/gov/stats/utils.js b/lib/v2/gov/stats/utils.js index a838d0f050..ce2a459d4a 100644 --- a/lib/v2/gov/stats/utils.js +++ b/lib/v2/gov/stats/utils.js @@ -33,6 +33,15 @@ const parseXilan = async (item, ctx) => const title = $('.xilan_titf').text(); item.author = title.match(/来源:(.*)发布时间/)?.[1].trim() ?? '国家统计局'; item.pubDate = timezone(parseDate(title.match(/发布时间:(.*)/)?.[1].trim() ?? item.pubDate), +8); + + // Change the img src from relative to absolute for a better compatibility + $('.xilan_con') + .find('img') + .each((_, el) => { + $(el).attr('src', new URL($(el).attr('src'), item.link).href); + // oldsrc is causing freshrss imageproxy not to work correctly + $(el).removeAttr('oldsrc').removeAttr('alt'); + }); item.description = $('.xilan_con').html(); const attachmentTitle = $('.wenzhang_tit').filter(function () {