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

Crashes/conversion issues around gender neutral emoji #157

Open
eramdam opened this issue Mar 17, 2022 · 0 comments
Open

Crashes/conversion issues around gender neutral emoji #157

eramdam opened this issue Mar 17, 2022 · 0 comments

Comments

@eramdam
Copy link
Contributor

eramdam commented Mar 17, 2022

The crash

The following snippet (tested on 3.7.0) leads to a crash:

const EmojiConvertor = require('emoji-js')
var emoji = new EmojiConvertor()
 emoji.colons_mode = true
 emoji.replace_unified(`🧑🏻‍🤝‍🧑🏼`)
Uncaught TypeError: Cannot read properties of undefined (reading '3')
    at emoji.replacement (/Users/damien/Developer/Git/xxx/xxx/node_modules/emoji-js/lib/emoji.js:369:50)
    at emoji.replacement (/Users/damien/Developer/Git/xxx/xxx/node_modules/emoji-js/lib/emoji.js:363:17)
    at /Users/damien/Developer/Git/xxx/xxx/node_modules/emoji-js/lib/emoji.js:306:17
    at String.replace (<anonymous>)
    at emoji.replace_unified (/Users/damien/Developer/Git/xxx/xxx/node_modules/emoji-js/lib/emoji.js:284:14)

https://emojipedia.org/people-holding-hands/

As far as I can tell, any gender-neutral variations using skin tone modifiers leads to the crash .

The conversion issue

This one is, I assume a mapping issue(?), but it seems like gender-neutral versions of some single-person emoji are converted into :woman-* instead of :person-*.
A few examples:

> emoji.replace_unified(`🙅`)
':woman-gesturing-no:'
> emoji.replace_unified(`🙎`)
':woman-pouting:'
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

1 participant