Fix titles on emojis

This commit is contained in:
Pavel Djundik 2018-08-31 13:33:16 +03:00
parent 5d4400ef90
commit e2c65fd0de

View File

@ -115,13 +115,16 @@ module.exports = function parse(createElement, text, message = undefined, networ
}, },
}, fragments); }, fragments);
} else if (textPart.emoji) { } else if (textPart.emoji) {
const title = emojiMap[textPart.emoji] ? `Emoji: ${emojiMap[textPart.emoji]}` : null;
return createElement("span", { return createElement("span", {
class: [ class: [
"emoji", "emoji",
], ],
attrs: { attrs: {
"role": "img", "role": "img",
"aria-label": emojiMap[textPart.emoji] ? `Emoji: ${emojiMap[textPart.emoji]}` : null, "aria-label": title,
"title": title,
}, },
}, fragments); }, fragments);
} else if (textPart.nick) { } else if (textPart.nick) {