diff --git a/lib/v2/jike/topic.js b/lib/v2/jike/topic.js index 3aca515f6905d3..370151665a2f9c 100644 --- a/lib/v2/jike/topic.js +++ b/lib/v2/jike/topic.js @@ -4,6 +4,8 @@ const cheerio = require('cheerio'); const dayjs = require('dayjs'); const { constructTopicEntry } = require('@/v2/jike/utils'); +const urlRegex = /(https?:\/\/[^\s"'<>]+)/g; + module.exports = async (ctx) => { const id = ctx.params.id; const topicUrl = `https://m.okjike.com/topics/${id}`; @@ -33,6 +35,7 @@ module.exports = async (ctx) => { return description; }); } + item.description = item.description.replaceAll(urlRegex, (url) => `${url}`); item.title = `${data.topic.content} ${dayjs(one.pubDate).format('MM月DD日')}`; return item; })