Last active
August 28, 2019 21:04
-
-
Save theworkerant/f0133c69ee11d07e4808d56739cb9aad to your computer and use it in GitHub Desktop.
Emojify LiveView message
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import EmojiConvertor from "emoji-js" | |
let emoji = new EmojiConvertor | |
// Emojify on mount hook | |
let messageHTML = this.el.getElementsByTagName("p")[0] | |
if (messageHTML) { | |
messageHTML.innerHTML = emoji.replace_colons(messageHTML.innerHTML) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
npm install emoji-js --save --prefix assets |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment