How replace emoji codes in html to Emoji Component?
See original GitHub issueHello,
I want to display the Emoji Component like bellow but I don’t know how can I replace the html result with component like:
Can you help me with this please?
Thank you.
I get html like this
Hello, how are you? :thumbsup:
I would like to get something like this:
Hello, how are you? <Emoji emoji=':thumbsup:' size={64} />
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:16 (3 by maintainers)
Top Results From Across the Web
Using Emojis in HTML - W3Schools
Emojis look like images, or icons, but they are not. They are letters (characters) from the UTF-8 (Unicode) character set. UTF-8 covers almost...
Read more >Using Emojis in HTML, CSS, and JavaScript - KIRUPA
Specifying the Emoji Codepoint To specify this emoji in HTML using the codepoint, we have to modify the value a bit. Add the...
Read more >How to add Emoji's in your website, using HTML, CSS or ...
Emoji's in the Web · Insert in HTML by copy pasting · Insert in HTML with its codepoint (replace U+ with &#x) ·...
Read more >How to add emoji in HTML document ? - GeeksforGeeks
Emojis can be added in HTML document by specifying their hexadecimal code within the required tags. These codes start with &#x and end...
Read more >How can I use a diffrent style for emojis? - Stack Overflow
You cannot modify the rendering of emoji directly. Regardless of font-face, the user's browser and OS determine how emoji characters are ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
👋
You will need a regex to detect the colons-syntax emojis, then you will be able to reconstruct your children with a mix of strings and
Emoji
components (given you already are in a React app)Here’s a quick snippet of how we parse them in Missive:
The
colons
variable can be used as-is w/ theEmoji
component:<Emoji emoji={colons}>
, it supports skin color too.The rest (instead of the
console.log
) can vary depending on many factors, so I’ll let you figure out how that can be implemented in your app 😄Just tested on latest chrome and safari.