-
Notifications
You must be signed in to change notification settings - Fork 61
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
Support Emojis #14
Comments
That would be cool. Mac Terminal supports them at least, I don't know about cross platform though. For instance what does $ echo "\xF0\x9F\x98\x80" show on Linux or Windows? Github has a overview of all the emojis it support and it's unicode here: https://api.github.com/emojis |
I have a working example of this now, using something like: function insertEmojis(text) {
return text.replace(/:([A-Za-z0-9_\-\+]+?):/g, function (emojiString) {
return emoji.get(emojiString) + ' ';
});
} But I need to add an option for using it, add some tests, and see how it works cross platform. Also probably need to extend the regex to not apply if inside code-block. |
Looks good. Yeah exactly it should not be shown in code blocks. That's the only gotcha. It's supported by Windows 7+ and Mac. Linux users usually need to change their terminal font. However I think it should be done per default on all systems - and then there should be an option to disable this. I don't think there is a good test if emojis are supported in a terminal. Maybe you can use this for getting the emojis: https://www.npmjs.com/package/gemoji |
I used https://www.npmjs.com/package/node-emoji and it seemed to work as expected on the Mac Terminal. |
Pushed support for emojis now. Would be great if you could test it out and verify. |
I just tried
|
Good point. I completely forgot. Fixed now in 9196c03.
There might be differences, I suspect, but until we find something better I think it'll do. As far as I see there's a pretty extensive list, so hopefully it works for the time being. |
📝 is actually listed here, so might be a bug: https://github.com/omnidan/node-emoji/blob/master/lib/emojifile.js#L561 Will look into this, probably fine to use it. Otherwise it works fine for me! |
GitHub flavored markdown allows for emojis like this
:poop:
💩. We should support them as well. Haven't found a good module yet for the conversion though.The text was updated successfully, but these errors were encountered: