Skip to content

Commit

Permalink
feat: rename twitter
Browse files Browse the repository at this point in the history
  • Loading branch information
OpportunityLiu committed May 18, 2024
1 parent b20bb29 commit 7ddb50f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/browser/app/editor/editor.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@
<mat-hint
>输入标签的相关链接,如指向{{
((inputs.namespace | async) || (original.namespace | async)) === 'artist'
? '画师的微博、pixiv、Twitter 或个人主页'
? '画师的微博、pixiv、X 或个人主页'
: ((inputs.namespace | async) || (original.namespace | async)) === 'group'
? '社团或公司的官方网站'
: ((inputs.namespace | async) || (original.namespace | async)) === 'parody'
Expand Down
6 changes: 3 additions & 3 deletions src/server/dtos/repo-info.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ export class RepoInfoDto implements RepoInfo {
raw: 'twinbox',
name: 'TwinBox',
intro: '「TwinBox」是`hanahanamaki`和`sousouman`共同的同人社团名称,同时也是商业活动的笔名。\n',
links: '[Twitter](https://twitter.com/digimon215) [pixiv](https://www.pixiv.net/users/264932) [微博](https://weibo.com/u/5189316437) [官方网站](https://www.twinbox-tb.com)\n',
links: '[X](https://x.com/digimon215) [pixiv](https://www.pixiv.net/users/264932) [微博](https://weibo.com/u/5189316437) [官方网站](https://www.twinbox-tb.com)\n',
},
},
count: 12406,
Expand All @@ -337,7 +337,7 @@ export class RepoInfoDto implements RepoInfo {
raw: 'oouso',
name: '大嘘',
intro: '![大嘘头像](https://tva1.sinaimg.cn/large/6c84b2d6gy1fjkes482gzj204q04qmxx.jpg)\n袜控,尻控,女子高中生(误)画家。\n',
links: '[Twitter](https://twitter.com/u_s_o) [pixiv](https://www.pixiv.net/users/457541)\n',
links: '[X](https://x.com/u_s_o) [pixiv](https://www.pixiv.net/users/457541)\n',
},
},
count: 12072,
Expand All @@ -360,7 +360,7 @@ export class RepoInfoDto implements RepoInfo {
raw: 'sayako',
name: 'さやこ',
intro: '',
links: '[Twitter](https://twitter.com/sayako_cos)',
links: '[X](https://x.com/sayako_cos)',
},
},
count: 49,
Expand Down
8 changes: 5 additions & 3 deletions src/shared/markdown/md-parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ function normalizeUrl(url: string): {
return { url, nsfw: eh.groups['domain'].includes('exhentai') ? 'R18' : undefined };
}

for (const [reg, rep] of konwnPermlinks) {
for (const [reg, rep] of knownPermalinks) {
url = url.replace(reg, rep);
}
return { url };
Expand All @@ -81,7 +81,7 @@ const knownHosts = new Map<string, string>([
['bilibili.com', '哔哩哔哩'],
['youtube.com', 'YouTube'],
['weibo.com', '微博'],
['twitter.com', 'Twitter'],
['x.com', 'X'],
['instagram.com', 'Instagram'],
['facebook.com', '脸书'],
['tumblr.com', 'Tumblr'],
Expand All @@ -98,7 +98,9 @@ const knownHosts = new Map<string, string>([
['dlsite.com', 'DLsite'],
]);

const konwnPermlinks: ReadonlyArray<[RegExp, string]> = [
const knownPermalinks: ReadonlyArray<[RegExp, string]> = [
// twitter 的 ** 新名字
[/^(http|https):\/\/twitter.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 7ddb50f

Please sign in to comment.