From d41a216c498c345ef735276169a1b7399ba89d19 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Thu, 8 Oct 2020 14:18:20 +0200 Subject: [PATCH] link at mentions to external profile page Signed-off-by: Robin Appelman --- src/components/MessageContent.js | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/src/components/MessageContent.js b/src/components/MessageContent.js index 2964179d..d2637a41 100644 --- a/src/components/MessageContent.js +++ b/src/components/MessageContent.js @@ -65,7 +65,7 @@ function transformText(createElement, text) { to: { name: 'profile', params: { account: match[2].substr(1) } - } + }, } }, [match[3]] @@ -120,18 +120,12 @@ function cleanLink(createElement, node, context) { case 'mention': var tag = matchMention(context.mentions, node.getAttribute('href'), node.textContent) if (tag) { - return createElement( - 'router-link', - { - props: { - to: { - name: 'profile', - params: { account: tag.name.substr(1) } - } - } - }, - [node.textContent] - ) + attributes['rel'] = 'nofollow noopener noreferrer' + attributes['target'] = '_blank' + attributes['href'] = node.getAttribute('href') + attributes['title'] = tag.name + + return createElement('a', { attrs: attributes }, [transformText(createElement, node.textContent)]) } else { return transformText(createElement, node.textContent) }