diff options
author | Harrison Healey <harrisonmhealey@gmail.com> | 2016-05-05 15:35:01 -0400 |
---|---|---|
committer | Corey Hulen <corey@hulen.com> | 2016-05-05 12:35:01 -0700 |
commit | ed3162a59d522981cd6b63e578d31e0a96b5d2ff (patch) | |
tree | 3e70807996077605fa45677efced738f71923db6 /webapp/utils/text_formatting.jsx | |
parent | 511be7714b1939892f687bbdb46f0598916adf23 (diff) | |
download | chat-ed3162a59d522981cd6b63e578d31e0a96b5d2ff.tar.gz chat-ed3162a59d522981cd6b63e578d31e0a96b5d2ff.tar.bz2 chat-ed3162a59d522981cd6b63e578d31e0a96b5d2ff.zip |
Moved twemoji parsing so that it doesn't occur inside of code blocks (#2896)
Diffstat (limited to 'webapp/utils/text_formatting.jsx')
-rw-r--r-- | webapp/utils/text_formatting.jsx | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/webapp/utils/text_formatting.jsx b/webapp/utils/text_formatting.jsx index 88dc412ca..cb61ecc8d 100644 --- a/webapp/utils/text_formatting.jsx +++ b/webapp/utils/text_formatting.jsx @@ -7,6 +7,7 @@ import Constants from './constants.jsx'; import * as Emoticons from './emoticons.jsx'; import * as Markdown from './markdown.jsx'; import UserStore from 'stores/user_store.jsx'; +import twemoji from 'twemoji'; import * as Utils from './utils.jsx'; // Performs formatting of user posts including highlighting mentions and search terms and converting urls, hashtags, and @@ -62,6 +63,14 @@ export function doFormatText(text, options) { // reinsert tokens with formatted versions of the important words and phrases output = replaceTokens(output, tokens); + if (!('emoticons' in options) || options.emoticon) { + output = twemoji.parse(output, { + className: 'emoticon', + base: '', + folder: Constants.EMOJI_PATH + }); + } + return output; } |