mathiasbynens / emoji-regex

A regular expression to match all Emoji-only symbols as per the Unicode Standard.
https://mths.be/emoji-regex
MIT License
1.74k stars 174 forks source link

Handle πŸ‘β€πŸ—¨ #4

Closed porada closed 8 years ago

porada commented 8 years ago

Looks like the script doesn’t match the character properly:

'<p>Foo πŸ‘β€πŸ—¨ Bar</p>'.replace(emojiRegex(), function(match) {
  return '<b>' + match + '</b>';
});

// β†’ <p>Foo <b>πŸ‘</b>β€πŸ—¨ Bar</p>
mathiasbynens commented 8 years ago

This is:

  1. U+1F441 EYE
  2. U+200D ZERO WIDTH JOINER
  3. U+1F5E8 LEFT SPEECH BUBBLE

Note that U+1F5E8 is not in the list of emoji.

This repo is based on the Unicode standard though, and I’d rather not add exceptions to it based on non-standard extensions. Similar issue: https://github.com/mathiasbynens/emoji-regex/issues/2#issuecomment-118503456

For example, πŸ‘β€πŸ—¨ only seems to get rendered as a single glyph on Apple’s operating systems. So whether you want to treat it as a single unit or not depends on the system you’re writing code for.

porada commented 8 years ago

Okay, that makes sense. Thanks. :v: