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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃帠 is not matched #32

Closed
brekk opened this issue Feb 10, 2018 · 2 comments
Closed

馃帠 is not matched #32

brekk opened this issue Feb 10, 2018 · 2 comments

Comments

@brekk
Copy link

brekk commented Feb 10, 2018

Hey there,

Love this library, but I've been seeing some new(er) emojis that are not matched correctly?

import emojiRegex from 'emoji-regex'
const e = emojiRegex()
e.test('馃帠') // false

Thanks,

Brekk

@astoilkov
Copy link

I can add 馃棥 to this issue.

@gilmoreorless
Copy link
Contributor

Both of those are defined in the Emoji category but not the Emoji_Presentation category in the Unicode source data. Technically they're meant to have different representations for "plain text" vs "emoji" modes, based on the presence or absence of the presentation selector U+FE0F. Unfortunately OSes are notoriously sloppy with adhering to that (see #28 (comment)), and the default regex is not matching the "plain text" variant.

Those characters are matched by the text version of emoji-regex, which ignores the presentation selector:

const emojiRegex = require('emoji-regex')
emojiRegex().test('馃帠')  // false

const emojiTextRegex = require('emoji-regex/text')
emojiTextRegex().test('馃帠')  // true

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

4 participants