Fix nicks with special characters being colored incorrectly in messages

Fixes #2362
This commit is contained in:
Pavel Djundik 2018-04-16 14:45:08 +03:00
parent efae5fd28d
commit 73b1124dce

View File

@ -122,7 +122,7 @@ module.exports = function parse(text, users) {
return `<span class="emoji" role="img" aria-label="Emoji: ${emojiMap[textPart.emoji]}" title="${emojiMap[textPart.emoji]}">${fragments}</span>`; return `<span class="emoji" role="img" aria-label="Emoji: ${emojiMap[textPart.emoji]}" title="${emojiMap[textPart.emoji]}">${fragments}</span>`;
} else if (textPart.nick) { } else if (textPart.nick) {
const nick = Handlebars.Utils.escapeExpression(textPart.nick); const nick = Handlebars.Utils.escapeExpression(textPart.nick);
return `<span role="button" class="user ${colorClass(nick)}" data-name="${nick}">${fragments}</span>`; return `<span role="button" class="user ${colorClass(textPart.nick)}" data-name="${nick}">${fragments}</span>`;
} }
return fragments; return fragments;