Improve emoji support: no commas

This commit is contained in:
Midgard 2021-04-26 17:40:07 +02:00
parent 72f6a3e201
commit 4322f824ff
Signed by: midgard
GPG key ID: 511C112F1331BBB4

View file

@ -54,9 +54,12 @@ function populateChannelList() {
function transformMessageText(message) { function transformMessageText(message) {
return message.split(/(?<=:|\W|^)(:[a-z0-9_-]+:)(?=:|\W|$)/).map( return message
(x, i) => i % 2 ? emoji[x.slice(1, -1)] || x : x .split(/(?<=:|\W|^)(:[a-z0-9_-]+:)(?=:|\W|$)/)
); .map((x, i) => i % 2
? emoji[x.slice(1, -1)] || x
: x)
.join("");
} }