Merge pull request #2363 from thelounge/xpaw/fix-2362

Fix nicks with special characters being colored incorrectly in messages
This commit is contained in:
Jérémie Astori 2018-04-16 15:24:53 +02:00 committed by GitHub
commit 62917d3d1f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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>`;
} else if (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;