From 162b56f5cb8a97070219556a339bfc620dd27e37 Mon Sep 17 00:00:00 2001 From: jviide Date: Mon, 9 Jan 2023 16:47:41 +0200 Subject: [PATCH] fix: add nofollow noreferrer noopener to Twitter mentions (#910) --- 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 e88f2083..0692adfc 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}`, target: '_blank', class: 'mention external' }, `@${c}@twitter.com`)], + [/\B@([a-zA-Z0-9_]+)@twitter\.com\b/gi, c => h('a', { href: `https://twitter.com/${c}`, target: '_blank', rel: 'nofollow noopener noreferrer', class: 'mention external' }, `@${c}@twitter.com`)], ] function _markdownProcess(value: string) {