From 363bcf329d2ba8e4a1e5a7e4ab6b878e1bd7f483 Mon Sep 17 00:00:00 2001 From: CaoMeiYouRen <40430746+CaoMeiYouRen@users.noreply.github.com> Date: Tue, 28 May 2024 12:18:20 +0800 Subject: [PATCH] =?UTF-8?q?fix(route):=20=E4=BF=AE=E5=A4=8D=20twitter=20?= =?UTF-8?q?=E8=B7=AF=E7=94=B1=E4=BC=9A=E5=8C=B9=E9=85=8D=E5=88=B0=20#=20?= =?UTF-8?q?=E5=BC=80=E5=A4=B4=E7=9A=84=E9=A2=9C=E8=89=B2=E5=AD=97=E7=AC=A6?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98=20(#15740)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/routes/twitter/utils.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/routes/twitter/utils.ts b/lib/routes/twitter/utils.ts index bccaa0ee5..337da7765 100644 --- a/lib/routes/twitter/utils.ts +++ b/lib/routes/twitter/utils.ts @@ -359,9 +359,10 @@ const ProcessFeed = (ctx, { data = [] }, params = {}) => { } description += item.full_text; + // 从 description 提取 话题作为 category,放在此处是为了避免 匹配到 quote 中的 # 80808030 颜色字符 + const category = description.match(/(\s)?(#[^\s;<]+)/g)?.map((e) => e?.match(/#([^\s<]+)/)?.[1]); description += img; description += quote; - const category = description.match(/(\s)?(#[^\s<]+)/g)?.map((e) => e?.match(/#([^\s<]+)/)?.[1]); if (readable) { description += `
`; }