From c647a87ba155b1680e687918ff06637b4ca25a6a Mon Sep 17 00:00:00 2001 From: Anthony Fu Date: Sun, 8 Jan 2023 11:43:14 +0100 Subject: [PATCH] fix(content): twitter handle matching --- composables/content-parse.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composables/content-parse.ts b/composables/content-parse.ts index 8deaa57a..e88f2083 100644 --- a/composables/content-parse.ts +++ b/composables/content-parse.ts @@ -322,7 +322,7 @@ const _markdownReplacements: [RegExp, (c: (string | Node)[]) => Node][] = [ [/~~(.*?)~~/g, c => h('del', null, c)], [/`([^`]+?)`/g, c => h('code', null, c)], // transform @username@twitter.com as links - [/(?:^|\b)@([a-zA-Z0-9_]+)@twitter\.com(?:$|\b)/gi, c => h('a', { href: `https://twitter.com/${c[0]}`, target: '_blank', class: 'mention external' }, `@${c[0]}@twitter.com`)], + [/\B@([a-zA-Z0-9_]+)@twitter\.com\b/gi, c => h('a', { href: `https://twitter.com/${c}`, target: '_blank', class: 'mention external' }, `@${c}@twitter.com`)], ] function _markdownProcess(value: string) {