Closed ZDemeter closed 5 years ago
I cannot reproduce the issue using the latest version:
const emojiRegex = require('emoji-regex');
const string = '\u270C\uFE0F'; // '✌️'
console.log(
string.match(emojiRegex())
);
// → [ '✌️' ]
Closing as fixed.
When matching a string for emojis, the returned match does not include the entire emoji.
For example,
Instead match[0] returns
The match doesn't include the entire emoji. An emoji consists of 2 16-bit code points, but for some emojis, only the first code point is matched and returned, giving these weird emojis in browsers.
(A couple of minutes in https://thekevinscott.com/emojis-in-javascript/ , and I can pretend to know anything about emojis 👍 )