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

Add support for emoji skintone #2

Merged

Conversation

amirahaile
Copy link
Contributor

@amirahaile amirahaile commented Aug 23, 2020

Context

Currently, this library generates blank aria-label strings for emojis with skin tones because the emoji dictionary this library is reliant upon,gemoiji, doesn't support emojis with skin tones.

This PR strips the skin tone unicode from emojis before querying gemoji so a description can be generated for the aria-label.

Concerns

Apple adds a variant selector, \uFE0F, to some emojis; Apple's unicode is what's used in gemoji.

Source Emoji Unicode
Mac-selected skin tone emoji ✌🏾 \u270C\uD83C\uDFFE
Stripped emoji \u270C
Mac-selected emoji ✌️ \u270C\uFE0F

gemoji is first queried with the stripped emojis in case there was no skin color on the emoji or it doesn't include the variant. If that fails to get a match, the variant is added and gemoji is queried again. An empty aria-label is the fallback.

Copy link
Owner

@florianeckerstorfer florianeckerstorfer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@amirahaile Thanks so much for the PR, this is awesome, I didn't knew you can detect the skint one like that 👍

@florianeckerstorfer florianeckerstorfer merged commit 13b3e74 into florianeckerstorfer:main Sep 26, 2020
@amirahaile amirahaile deleted the skin-tone-emojis branch September 28, 2020 16:54
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

Successfully merging this pull request may close these issues.

None yet

2 participants