About Detecting Emoji in JavaScript
Emojis are quite a beast of Unicode. They might take a varying amount of bytes depending on modifiers (like color and gender), and it's complicated to detect them. Nevertheless, here is one approach to wrap emoji into spans using regular expressions:
1 2 3 4 |
|
Tips and Tricks Programming JavaScript Regular Expressions Unicode