Skip to content

Commit 3a039c3

Browse files
committed
Update URL formatting and adjust priority values in shared constants and getPriority function
- Standardized URL entries in const.ts by removing trailing slashes for consistency. - Modified priority values in getPriority.ts to refine element handling, including adjustments to the 'cite' and 'figure' priorities and added a check for non-alphabetic inner text.
1 parent ed0fdd4 commit 3a039c3

File tree

2 files changed

+30
-27
lines changed

2 files changed

+30
-27
lines changed

packages/shared/const.ts

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,33 +4,34 @@ export const PROJECT_URL_OBJECT = {
44

55
export const ignoreHref = [
66
// 🔮 LLM 相关平台
7-
'https://chatgpt.com/',
8-
'https://chat.openai.com/', // ✅ 实际用户更多使用此地址
9-
'https://chat.deepseek.com/',
10-
'https://www.deepseek.com/',
7+
'https://chatgpt.com',
8+
'https://chat.openai.com', // ✅ 实际用户更多使用此地址
9+
'https://chat.deepseek.com',
10+
'https://www.deepseek.com',
1111
'https://gemini.google.com/app',
12-
'https://www.kimi.com/',
13-
'https://www.claude.ai/',
12+
'https://www.kimi.com',
13+
'https://www.claude.ai',
1414

1515
// 🇨🇳 中文网站(内容大概率为中文,不建议翻译)
16-
'https://www.163.com/', // 网易
17-
'https://www.qq.com/', // 腾讯
18-
'https://www.weixin.qq.com/', // 微信官网
19-
'https://www.jd.com/', // 京东
20-
'https://www.taobao.com/', // 淘宝
21-
'https://www.tmall.com/', // 天猫
22-
'https://www.sina.com.cn/', // 新浪新闻
23-
'https://www.weibo.com/', // 微博
24-
'https://www.zhihu.com/', // 知乎
25-
'https://www.bilibili.com/', // 哔哩哔哩
26-
'https://www.douyin.com/', // 抖音网页版
27-
'https://www.kuaishou.com/', // 快手
28-
'https://www.xhs.com/', // 小红书
29-
'https://www.huxiu.com/', // 虎嗅
30-
'https://www.36kr.com/', // 36氪
31-
'https://www.cctv.com/', // 央视网
32-
'https://www.people.com.cn/', // 人民网
33-
'https://www.chinanews.com.cn/', // 中国新闻网
34-
'https://www.gov.cn/', // 中国政府网
35-
'https://www.gamersky.com/', // 游民星空
16+
'https://www.163.com', // 网易
17+
'https://www.qq.com', // 腾讯
18+
'https://www.weixin.qq.com', // 微信官网
19+
'https://www.jd.com', // 京东
20+
'https://www.taobao.com', // 淘宝
21+
'https://www.tmall.com', // 天猫
22+
'https://www.sina.com.cn', // 新浪新闻
23+
'https://www.weibo.com', // 微博
24+
'https://www.zhihu.com', // 知乎
25+
'https://www.bilibili.com', // 哔哩哔哩
26+
'https://www.douyin.com', // 抖音网页版
27+
'https://www.kuaishou.com', // 快手
28+
'https://www.xhs.com', // 小红书
29+
'https://www.huxiu.com', // 虎嗅
30+
'https://www.36kr.com', // 36氪
31+
'https://www.cctv.com', // 央视网
32+
'https://www.people.com.cn', // 人民网
33+
'https://www.chinanews.com.cn', // 中国新闻网
34+
'https://www.gov.cn', // 中国政府网
35+
'https://www.gamersky.com', // 游民星空
36+
'https://t.bilibili.com', // 游民星空
3637
];

pages/content/src/matches/all/getPriority.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,15 @@ const priorityMap: { [key: string]: number } = {
1010
sidebar: -20,
1111
menu: -20,
1212
options: -20,
13-
cite: -11,
13+
figure: -11,
14+
cite: -12,
1415
};
1516

1617
export const getPriority = (node: HTMLElement) => {
1718
const nodeName = node.nodeName;
1819
const innerText = node.innerText;
1920
let textBasedPriority = innerText.startsWith('#') ? -1 : 0;
2021
if (innerText.startsWith('@')) textBasedPriority = -1;
22+
if (!/^[a-zA-Z]/.test(innerText)) textBasedPriority = -1;
2123
return priorityMap[nodeName] ?? priorityMap[nodeName.toLowerCase()] ?? textBasedPriority ?? 0;
2224
};

0 commit comments

Comments
 (0)