From a4c0e9dd2e9dd516f71ceaa92e89b7cecab32bf4 Mon Sep 17 00:00:00 2001 From: Anthony Fu Date: Sun, 8 Jan 2023 09:21:35 +0100 Subject: [PATCH] chore: change top-level function style --- composables/content-parse.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/composables/content-parse.ts b/composables/content-parse.ts index 0ed0b748..f6e0aab7 100644 --- a/composables/content-parse.ts +++ b/composables/content-parse.ts @@ -315,6 +315,8 @@ const _markdownReplacements: [RegExp, (c: (string | Node)[]) => Node][] = [ [/\*(.*?)\*/g, c => h('em', null, c)], [/~~(.*?)~~/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`)], ] function _markdownProcess(value: string) {