From 3282d81ec458a348731dfec43da5c58f9edd9e25 Mon Sep 17 00:00:00 2001 From: Cadence Ember Date: Wed, 20 May 2020 03:36:51 +1200 Subject: [PATCH] Mentions are disabled by non-word instead of space --- src/lib/utils/structuretext.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/utils/structuretext.js b/src/lib/utils/structuretext.js index 0a71351..f40e746 100644 --- a/src/lib/utils/structuretext.js +++ b/src/lib/utils/structuretext.js @@ -31,7 +31,7 @@ function partsUsername(parts) { for (let i = 0; i < parts.length; i++) { if (parts[i].type === "text") { tryMatch(parts[i].text, new RegExp(`@(${constants.external.username_regex})`, "g"), match => { - if (match.index === 0 || parts[i].text[match.index-1].match(/\s/)) { // check that there's a space before the username + if (match.index === 0 || parts[i].text[match.index-1].match(/\W/)) { // check that there isn't a word directly before the username replacePart(parts, i, match, [ {type: "user", text: match[0], user: match[1]} ])