emoji: Make unicode/span emojis more accessible.

This commit adds `aria-label="<title_text>"` and `role="img"` to
the generated HTML.

Fixes: #5975.
This commit is contained in:
Harshit Bansal
2019-01-14 07:45:37 +00:00
committed by Tim Abbott
parent 0051ca5db6
commit 5f76a65b1d
6 changed files with 35 additions and 32 deletions

View File

@@ -141,8 +141,9 @@ exports.is_status_message = function (raw_content, content) {
};
function make_emoji_span(codepoint, title, alt_text) {
return '<span class="emoji emoji-' + codepoint + '"' +
' title="' + title + '">' + alt_text +
return '<span aria-label="' + title + '"' +
' class="emoji emoji-' + codepoint + '"' +
' role="img" title="' + title + '">' + alt_text +
'</span>';
}