From 4322f824ff21d57fdc0da723f52a10ebc14defac Mon Sep 17 00:00:00 2001 From: Midgard Date: Mon, 26 Apr 2021 17:40:07 +0200 Subject: [PATCH] Improve emoji support: no commas --- js/view/view.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/js/view/view.js b/js/view/view.js index cc6ef52..11dfc84 100644 --- a/js/view/view.js +++ b/js/view/view.js @@ -54,9 +54,12 @@ function populateChannelList() { function transformMessageText(message) { - return message.split(/(?<=:|\W|^)(:[a-z0-9_-]+:)(?=:|\W|$)/).map( - (x, i) => i % 2 ? emoji[x.slice(1, -1)] || x : x - ); + return message + .split(/(?<=:|\W|^)(:[a-z0-9_-]+:)(?=:|\W|$)/) + .map((x, i) => i % 2 + ? emoji[x.slice(1, -1)] || x + : x) + .join(""); }