From 915ca67ed7b84a0f47caabc23a985bbc8bf600b2 Mon Sep 17 00:00:00 2001 From: OpportunityLiu Date: Sat, 18 May 2024 15:17:32 +0800 Subject: [PATCH] feat: normalize pixiv --- src/shared/markdown/md-parser.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/shared/markdown/md-parser.ts b/src/shared/markdown/md-parser.ts index 35ec2dec..d17869d3 100644 --- a/src/shared/markdown/md-parser.ts +++ b/src/shared/markdown/md-parser.ts @@ -100,8 +100,10 @@ const knownHosts = new Map([ ]); const knownPermalinks: ReadonlyArray<[RegExp, string]> = [ - // twitter 的 ** 新名字 - [/^(http|https):\/\/twitter.com\/(?.+)$/, 'https://x.com/$'], + // pixiv 链接使用语言无关 + [/^(http|https):\/\/(www\.)?pixiv\.net\/(en\/)?(?.+)$/, 'https://www.pixiv.net/$'], + // twitter 的 ** 新名字,使用桌面版 + [/^(http|https):\/\/(mobile\.)?(twitter|x)\.com\/(?.+)$/, 'https://x.com/$'], // pixiv 图片使用反代 [/^(http|https):\/\/i\.pximg\.net\/(?.+)$/, 'https://i.pixiv.cat/$'], // wikipedia 手机版使用桌面版