fix(route): 修复 twitter 路由会匹配到 # 开头的颜色字符的问题 (#15740)

This commit is contained in:
CaoMeiYouRen 2024-05-28 12:18:20 +08:00 committed by GitHub
parent 73c9e1fdfd
commit 363bcf329d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 1 deletions

View File

@ -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 += `<br clear='both' /><div style='clear: both'></div>`;
}