From dc5b85097e4197c415a4e9202149607b0994536b Mon Sep 17 00:00:00 2001 From: Benja Appel <78376862+Lyqst@users.noreply.github.com> Date: Thu, 21 Oct 2021 19:37:03 -0300 Subject: [PATCH] Fix chat @-mentions not opening in a modal (#13581) * fix #13276 * Fix eslint no-useless-concat --- website/client/src/components/chat/chatCard.vue | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/website/client/src/components/chat/chatCard.vue b/website/client/src/components/chat/chatCard.vue index 6a6163e851..ef0e5a1b06 100644 --- a/website/client/src/components/chat/chatCard.vue +++ b/website/client/src/components/chat/chatCard.vue @@ -282,11 +282,15 @@ export default { mounted () { const links = this.$refs.markdownContainer.getElementsByTagName('a'); for (let i = 0; i < links.length; i += 1) { - const link = links[i]; - if (links[i].getAttribute('href').startsWith('/profile/')) { + let link = links[i].pathname; + + // Internet Explorer does not provide the leading slash character in the pathname + link = link.charAt(0) === '/' ? link : `/${link}`; + + if (link.startsWith('/profile/')) { links[i].onclick = ev => { ev.preventDefault(); - this.$router.push({ path: link.getAttribute('href') }); + this.$router.push({ path: link }); }; } }