Skip to content

Commit

Permalink
feat: normalize pixiv
Browse files Browse the repository at this point in the history
  • Loading branch information
OpportunityLiu committed May 18, 2024
1 parent ed4ac63 commit 915ca67
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/shared/markdown/md-parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,10 @@ const knownHosts = new Map<string, string>([
]);

const knownPermalinks: ReadonlyArray<[RegExp, string]> = [
// twitter 的 ** 新名字
[/^(http|https):\/\/twitter.com\/(?<tail>.+)$/, 'https://x.com/$<tail>'],
// pixiv 链接使用语言无关
[/^(http|https):\/\/(www\.)?pixiv\.net\/(en\/)?(?<tail>.+)$/, 'https://www.pixiv.net/$<tail>'],
// twitter 的 ** 新名字,使用桌面版
[/^(http|https):\/\/(mobile\.)?(twitter|x)\.com\/(?<tail>.+)$/, 'https://x.com/$<tail>'],
// pixiv 图片使用反代
[/^(http|https):\/\/i\.pximg\.net\/(?<tail>.+)$/, 'https://i.pixiv.cat/$<tail>'],
// wikipedia 手机版使用桌面版
Expand Down

0 comments on commit 915ca67

Please sign in to comment.