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.73k stars 174 forks source link

wrapping emojis, possible? #47

Closed titoBouzout closed 5 years ago

titoBouzout commented 5 years ago

Hi! Im trying to wrap emojis in a span tag, but some emojis break.

When I do

console.log('🐱‍👤'.replace(emoji_text_regexp, '<span class="emoji-native">$1</span>')

I get

<span class="emoji-native">🐱</span>‍<span class="emoji-native">👤</span>

instead of

<span class="emoji-native">🐱‍👤</span>

is possible to use this library to wrap emojis with their modifiers? Thanks!