diff --git a/website/client/components/chat/chatCard.vue b/website/client/components/chat/chatCard.vue index dd5de80a9e..edebbe8315 100644 --- a/website/client/components/chat/chatCard.vue +++ b/website/client/components/chat/chatCard.vue @@ -298,7 +298,9 @@ export default { this.$emit('show-member-modal', memberId); }, atHighlight (text) { - const userRegex = new RegExp(`@(${this.user.auth.local.username}|${this.user.profile.name})(?:\\b)`, 'gi'); + const escapedDisplayName = escapeRegExp(this.user.profile.name); + const escapedUsername = escapeRegExp(this.user.auth.local.username); + const userRegex = new RegExp(`@(${escapedDisplayName}|${escapedUsername})(?:\\b)`, 'gi'); const atRegex = new RegExp(/(?!\b)@[\w-]+/g); if (userRegex.test(text)) {