Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emoji being showed as raw text #2182

Open
ritiek opened this issue Dec 22, 2017 · 8 comments
Open

Emoji being showed as raw text #2182

ritiek opened this issue Dec 22, 2017 · 8 comments

Comments

@ritiek
Copy link

ritiek commented Dec 22, 2017

There is an emoji being showed as raw text (with a ] next to it, for some reason). I haven't tested if :rofl: emoji is causing the problem or just because there is a blank line after it.

Above is as rendered by 24pullrequests while the one under it is the actual render (by GitHub).

rofl
(click to zoom)

Original raw text:

This repository, LMAO! :rofl:

Here is my first photoshop evva, thanks to this repository. :blush:
@andrew
Copy link
Member

andrew commented Dec 22, 2017

I suspect our emojify JavaScript library needs updating for the latest emojis: https://github.com/emojione/emojify.js

@adamyeats
Copy link
Contributor

@andrew emojify.js hasn't been updated in over 2 years... looks like we'll need a different emoji library here.

@andrew
Copy link
Member

andrew commented Dec 25, 2017

@xadamy d'oh, looks like you're right 😔

@emclaughlin1215
Copy link
Contributor

I've found a handful of libraries that could potentially replace emojify.js, but I'm not sure how to compare them to figure out which one is best to use. Hopefully someone else knows and can take this information and make a useful decision with it.

Emojis: https://github.com/iamcal/emoji-data
This seems to be a repo of emojis and shortcodes that's kept fairly up-to-date. At the bottom, it includes a list of libraries that use its data.

JS Emojis:
https://github.com/iamcal/js-emoji
This one makes use of the above library. As long as the emojis are stored as shortcodes in the DB, it looks like there's minimal setup required.

https://github.com/rodrigopolo/jqueryemoji
This one looks even simpler, and I think it's more lightweight? (I could be reading the entire thing wrong, though).

Ruby Emojis: https://github.com/mroth/emoji_data.rb
If doing away with the idea of a JS library for emojis entirely sounds like a good idea, here's a ruby gem that uses the same emoji-data emojis that js-emoji does.

So, if someone who is not me is willing to make a call and say "use this," I'm more than happy to take a stab at replacing emojify.js with whatever is chosen.

@andrew
Copy link
Member

andrew commented Apr 10, 2018

Thanks for looking into this @emclaughlin1215, jqueryemoji looks like a good fit for this project if you fancy tackling swapping out emojify.js?

@emclaughlin1215
Copy link
Contributor

@andrew So, it turns out that the real problem isn't so much that the emoji converter is out of date (although that is a problem) as that the shortcodes that github uses aren't necessarily the CLDR short name. For instance, github uses "rofl" as the shortcode instead of "rolling_on_the_floor_laughing," which is what the CLDR short name is and what it appears most other places I've checked use.

Github's API has a method that returns urls for the emojis keyed by the shortcode they use: https://api.github.com/emojis

I... am not sure what to do about this. I guess the general thing that would need to happen is:

  1. pull down and cache the json like once a month or whatever
  2. use the cached data to get the correct image URL for the emoji
  3. since I doubt we can just hotlink to github's cdn, parse the URL to get the unicode for the emoji?
  4. feed that to jqueryemoji?

@andrew
Copy link
Member

andrew commented Apr 10, 2018

@emclaughlin1215 another alternative might be https://github.com/github/gemoji, I've got that added to one of my other open source rails apps: octobox/octobox#571

@raineydavid
Copy link

This twitter emoji repository https://github.com/twitter/twemoji.git may be worth a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants