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

A common emoji (U+2764) cannot match #54

Closed
peterdaiweb opened this issue Jan 29, 2019 · 4 comments
Closed

A common emoji (U+2764) cannot match #54

peterdaiweb opened this issue Jan 29, 2019 · 4 comments

Comments

@peterdaiweb
Copy link

peterdaiweb commented Jan 29, 2019

emoji

this heart is black, but in wechat, when you spell "xin"(tip: heart by English), it's a red heart, its unicode is 2764

@abrad45
Copy link

abrad45 commented Apr 11, 2019

I don't believe this symbol is an emoji

@mindlink
Copy link

According to emoji pedia 2764 is an Emoji and part of Emoji 1.0:
https://emojipedia.org/heavy-black-heart/

@mislav
Copy link

mislav commented Nov 29, 2019

Let's see what the Unicode spec says about 2764:

2764 FE0F                                  ; fully-qualified     # ❤️ E2.0 red heart
2764                                       ; unqualified         # ❤ E2.0 red heart

We can see that 2764 without “variation selector 16” (FE0F) is an unqualified emoji:

ED-17a. qualified emoji character — An emoji character in a string that (a) has default emoji presentation or (b) is the first character in an emoji modifier sequence or (c) is not a default emoji presentation character, but is the first character in an emoji presentation sequence.

ED-18. fully-qualified emoji — A qualified emoji character, or an emoji sequence in which each emoji character is qualified.

ED-18a. minimally-qualified emoji — An emoji sequence in which the first character is qualified but the sequence is not fully qualified.

ED-19. unqualified emoji — An emoji that is neither fully-qualified nor minimally qualified.

The way I interpret it, 2764 without FE0F should not render as a color emoji by default, and therefore it should not be matched by emoji-regex.

@mathiasbynens
Copy link
Owner

@mislav is spot-on.

You can use /text.js to match this character, but the other regular expressions should not match it.

Generally, the philosophy behind emoji-regex is to avoid making decisions about which characters/sequences are emoji and which aren't, and instead let the Unicode Standard make those decisions.

@mathiasbynens mathiasbynens changed the title A common emoji cannot match A common emoji (U+2764) cannot match Oct 20, 2020
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