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

First entry for some emoji is slug, some are not #228

Closed
erquhart opened this issue Jun 26, 2024 · 2 comments
Closed

First entry for some emoji is slug, some are not #228

erquhart opened this issue Jun 26, 2024 · 2 comments

Comments

@erquhart
Copy link

erquhart commented Jun 26, 2024

I'm trying to reliably match an emoji slug to the list, but this isn't currently possible.

Most use a slug as the first entry in the list:

"😀": [
"grinning_face",
"face",
"smile",
"happy",
"joy",
":D",
"grin"
],

But some use spaces instead of underscore, so they can't be matched by slug:

emojilib/dist/emoji-en-US.json

Lines 12998 to 13003 in 0e7aca3

"🙂‍↔️": [
"head shaking horizontally",
"disapprove",
"indiffernt",
"left"
],

Is this intentional, or is it too late to fix?

@muan
Copy link
Owner

muan commented Jun 26, 2024

The space separated one I think might only be the newer ones since the slug responsibility was moved over to https://github.com/muan/unicode-emoji-json since 3.x. See "slug" field.

However, I wouldn't say that is "reliable". The Unicode emoji spec itself changes name of emoji every now and then as well. For example Gun was changed to Water Gun between versions. If you want something reliable it might either have to be custom maintained yourself or follow one of those platform specific short codes from GitHub, Slack, Discord, and the likes.

It's not too late to fix but there isn't a standardized way for this yet (#194).

If I were to make a decision today I'd lean towards using space separated emoji names as keywords.

@erquhart
Copy link
Author

Thanks for the response. I'd expect a primary use case to be storing an emoji reference as a string in a db, whether standalone or in markdown. In either case a slug-style string is pretty much the norm.

At any rate, I've switched to mapping directly against unicode-emoji-json to address this.

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

No branches or pull requests

2 participants