From bff49551516c1a312b5205acc9395ded334ccac8 Mon Sep 17 00:00:00 2001 From: Danila Fedorin Date: Fri, 27 Aug 2021 16:59:09 -0700 Subject: [PATCH] Do not open internal links in new tab --- src/platform/web/ui/session/room/timeline/TextMessageView.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platform/web/ui/session/room/timeline/TextMessageView.js b/src/platform/web/ui/session/room/timeline/TextMessageView.js index fcafaf27..c30c4134 100644 --- a/src/platform/web/ui/session/room/timeline/TextMessageView.js +++ b/src/platform/web/ui/session/room/timeline/TextMessageView.js @@ -94,7 +94,7 @@ const formatFunction = { table: tableBlock => renderTable(tableBlock), code: codePart => tag.code(text(codePart.text)), text: textPart => text(textPart.text), - link: linkPart => tag.a({href: linkPart.url, className: "link", target: "_blank", rel: "noopener" }, renderParts(linkPart.inlines)), + link: linkPart => tag.a({href: linkPart.url, className: "link", target: linkPart.internal ? "_self" : "_blank", rel: "noopener" }, renderParts(linkPart.inlines)), pill: renderPill, format: formatPart => tag[formatPart.format](renderParts(formatPart.children)), rule: () => tag.hr(),