add custom emoticons

This commit is contained in:
Devin Howard 2017-01-09 15:34:50 -05:00
parent 492a41f19b
commit daab6ef78b

View file

@ -174,7 +174,10 @@ const Util = {
text = text.replace(new RegExp(escapeRegExp(emoji.colons), 'g'), emoji.native)
})
if (opts.emoticons) {
Object.keys(emojiIndex.emoticons).forEach(emoticon => {
const emoticons = Object.assign({}, emojiIndex.emoticons, {
':D': ':grin:'
})
Object.keys(emoticons).forEach(emoticon => {
const key = emojiIndex.emoticons[emoticon]
const emoji = emojiIndex.emojis[key]
text = text.replace(new RegExp(escapeRegExp(emoticon), 'g'), emoji.native)