From 510df0ac556377f6dcd2f7e3e6237ef6035f06d6 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Mon, 25 Sep 2017 18:36:33 +0200 Subject: Fix emojify() by generating a mapping to existing Twemoji files (#5080) A new rake task emojis:generate downloads a full list of valid unicode sequences from unicode.org and checks it against existing Twemoji files, finally generating a map from each sequence to the existing file (e.g. when there's multiple ways an emoji can be expressed). The map is dumped into app/javascript/mastodon/emoji_map.json That file is loaded by emojione_light.js (now a misnomer) which decorates it further with shortcodes taken from emoji-mart's index. --- spec/javascript/components/emojify.test.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'spec/javascript/components') diff --git a/spec/javascript/components/emojify.test.js b/spec/javascript/components/emojify.test.js index 9451a7920..6e73c9251 100644 --- a/spec/javascript/components/emojify.test.js +++ b/spec/javascript/components/emojify.test.js @@ -22,10 +22,10 @@ describe('emojify', () => { it('does unicode', () => { expect(emojify('\uD83D\uDC69\u200D\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66')).to.equal( - '๐Ÿ‘ฉโ€๐Ÿ‘ฉโ€๐Ÿ‘ฆโ€๐Ÿ‘ฆ'); - expect(emojify('\uD83D\uDC68\uD83D\uDC69\uD83D\uDC67\uD83D\uDC67')).to.equal( - '๐Ÿ‘จ๐Ÿ‘ฉ๐Ÿ‘ง๐Ÿ‘ง'); - expect(emojify('\uD83D\uDC69\uD83D\uDC69\uD83D\uDC66')).to.equal('๐Ÿ‘ฉ๐Ÿ‘ฉ๐Ÿ‘ฆ'); + '๐Ÿ‘ฉโ€๐Ÿ‘ฉโ€๐Ÿ‘ฆโ€๐Ÿ‘ฆ'); + expect(emojify('๐Ÿ‘จโ€๐Ÿ‘ฉโ€๐Ÿ‘งโ€๐Ÿ‘ง')).to.equal( + '๐Ÿ‘จโ€๐Ÿ‘ฉโ€๐Ÿ‘งโ€๐Ÿ‘ง'); + expect(emojify('๐Ÿ‘ฉโ€๐Ÿ‘ฉโ€๐Ÿ‘ฆ')).to.equal('๐Ÿ‘ฉโ€๐Ÿ‘ฉโ€๐Ÿ‘ฆ'); expect(emojify('\u2757')).to.equal( 'โ—'); }); -- cgit