emoji: Fix the title and alt text for unicode emojis.

Unicode emojis when rendered should display canonical short name.
Similarly, the alt text should be of the format `:<short_name>:`.
For both of these we currently display the actual unicode symbol.
As some systems don't have the fonts necessary for displaying them
properly, they are rendered as empty square blocks. This commit also
ensures that the markup generated for emoji generated by canonical
name and by an unicode emoji is same.

Fixes: #5555.
This commit is contained in:
Harshit Bansal
2017-06-20 19:22:14 +05:30
committed by Tim Abbott
parent 8c92024fae
commit 4cb8ac100a
6 changed files with 32 additions and 18 deletions

View File

@@ -221,7 +221,7 @@ var bugdown_data = JSON.parse(fs.readFileSync(path.join(__dirname, '../../zerver
{input: 'This is an :poop: message',
expected: '<p>This is an <img alt=":poop:" class="emoji" src="/static/generated/emoji/images/emoji/unicode/1f4a9.png" title=":poop:"> message</p>'},
{input: "\ud83d\udca9",
expected: '<p><img alt="\ud83d\udca9" class="emoji" src="/static/generated/emoji/images/emoji/unicode/1f4a9.png" title="\ud83d\udca9"></p>'},
expected: '<p><img alt=":poop:" class="emoji" src="/static/generated/emoji/images/emoji/unicode/1f4a9.png" title=":poop:"></p>'},
{input: '\u{1f937}',
expected: '<p>\u{1f937}</p>' },
{input: 'This is a realm filter #1234 with text after it',