From cc69188cae2132be1c16e7930e47f1e05fbba89f Mon Sep 17 00:00:00 2001 From: Bogdanova Olga Date: Thu, 25 Feb 2021 00:16:00 +0300 Subject: [PATCH] Issues-433: wrap non-word chars in mentions --- js/topcodereditor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/topcodereditor.js b/js/topcodereditor.js index 1395cc1..6ebc133 100644 --- a/js/topcodereditor.js +++ b/js/topcodereditor.js @@ -46,7 +46,7 @@ var result = []; $.each(data, function (i, item) { var text = data[i].handle; - if(text.indexOf('.') > -1) { + if(/[\W]/.test(text) > -1) { text = '"' + text + '"'; } result.push({text: text, displayText: data[i].handle, className: 'Username'});