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

Does not match all combinations of emojis that support multiple skin tones #65

Closed
scriby opened this issue Dec 30, 2019 · 7 comments
Closed

Comments

@scriby
Copy link
Collaborator

scriby commented Dec 30, 2019

For instance, the regex will match πŸ§‘πŸΌβ€πŸ€β€πŸ§‘πŸ» ('\u{1F9D1}\u{1F3FC}\u200D\u{1F91D}\u200D\u{1F9D1}\u{1F3FB}'), but it doesn't match πŸ§‘πŸ»β€πŸ€β€πŸ§‘πŸΌ ('\u{1F9D1}\u{1F3FB}\u200D\u{1F91D}\u200D\u{1F9D1}\u{1F3FC}'). It seems to only work if the darker skin tone is on the left side. There are some more emojis that support multiple skin tones coming, so it would be great if this could match against all possible combinations.

@scriby
Copy link
Collaborator Author

scriby commented Jan 2, 2020

It looks like this issue is resolved in Unicode 12.1 where both combinations are in the RGI.

@JuanCarlosC
Copy link

JuanCarlosC commented Feb 26, 2020

@scriby I am still experiencing the same issue where it will only work if the darker skin tone is on the left side. Did you find a solution?

I've used the inject-sequences.js script to update the regular expression based on the data from Unicode v12.1, but still seeing the same issue.

Screen Shot 2020-02-25 at 8 03 45 PM

@scriby
Copy link
Collaborator Author

scriby commented Feb 26, 2020 via email

@JuanCarlosC
Copy link

@scriby updated my comment above. Yes, I ran this script against 12.1. Are you no longer experiencing the issue?

@scriby
Copy link
Collaborator Author

scriby commented Feb 26, 2020 via email

@mathiasbynens
Copy link
Owner

If I understand the issue correctly, it looks like this has already been fixed when I updated to the latest Unicode version:

$ node -p "require('emoji-regex')().exec('\u{1F9D1}\u{1F3FC}\u200D\u{1F91D}\u200D\u{1F9D1}\u{1F3FB}')"
[ 'πŸ§‘πŸΌβ€πŸ€β€πŸ§‘πŸ»', index: 0, input: 'πŸ§‘πŸΌβ€πŸ€β€πŸ§‘πŸ»', groups: undefined ]

$ node -p "require('emoji-regex')().exec('\u{1F9D1}\u{1F3FB}\u200D\u{1F91D}\u200D\u{1F9D1}\u{1F3FC}')"
[ 'πŸ§‘πŸ»β€πŸ€β€πŸ§‘πŸΌ', index: 0, input: 'πŸ§‘πŸ»β€πŸ€β€πŸ§‘πŸΌ', groups: undefined ]

@scriby Can you confirm this is now behaving as you expected?

@mathiasbynens
Copy link
Owner

Closing since I believe this has been resolved. Feel free to reopen if I misunderstood.

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

3 participants