From 9c8f935e0333651690e1eb8dec59453efea139a5 Mon Sep 17 00:00:00 2001 From: Audric Ackermann Date: Wed, 26 May 2021 15:40:33 +1000 Subject: [PATCH] fix up dirty hack to display mentions correctly Fixes #1658 --- .../session/conversation/SessionCompositionBox.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ts/components/session/conversation/SessionCompositionBox.tsx b/ts/components/session/conversation/SessionCompositionBox.tsx index 057a3a676..a5aca0a6f 100644 --- a/ts/components/session/conversation/SessionCompositionBox.tsx +++ b/ts/components/session/conversation/SessionCompositionBox.tsx @@ -135,7 +135,7 @@ export class SessionCompositionBox extends React.Component { private emojiPanel: any; private linkPreviewAbortController?: AbortController; private container: any; - private readonly mentionsRegex = /@\u{FFD2}05[0-9a-f]{64}:[^\u{FFD2}]+\u{FFD2}/gu; + private readonly mentionsRegex = /@\uFFD205[0-9a-f]{64}\uFFD7[^\uFFD2]+\uFFD2/gu; private lastBumpTypingMessageLength: number = 0; constructor(props: any) { @@ -366,7 +366,7 @@ export class SessionCompositionBox extends React.Component { `@${display}`} @@ -751,7 +751,7 @@ export class SessionCompositionBox extends React.Component { const matches = text.match(this.mentionsRegex); let replacedMentions = text; (matches || []).forEach(match => { - const replacedMention = match.substring(2, match.indexOf(':')); + const replacedMention = match.substring(2, match.indexOf('\uFFD7')); replacedMentions = replacedMentions.replace(match, `@${replacedMention}`); });