From 4c497454b67ac72ea62dc32dbf8f4f70ce11e8fa Mon Sep 17 00:00:00 2001 From: Gabe Kangas Date: Sat, 12 Sep 2020 18:01:53 -0700 Subject: [PATCH] Give highlights a little padding --- webroot/js/utils/chat.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/webroot/js/utils/chat.js b/webroot/js/utils/chat.js index 89f0f8f53..e78fd216c 100644 --- a/webroot/js/utils/chat.js +++ b/webroot/js/utils/chat.js @@ -24,7 +24,10 @@ export function formatMessageText(message, username) { function highlightUsername(message, username) { const pattern = new RegExp('@?' + username.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'), 'gi'); - return message.replace(pattern, '$&'); + return message.replace( + pattern, + '$&' + ); } function linkify(text, rawText) {