summaryrefslogtreecommitdiffstats
path: root/web/react/utils/text_formatting.jsx
diff options
context:
space:
mode:
authorhmhealey <harrisonmhealey@gmail.com>2015-09-22 13:53:43 -0400
committerhmhealey <harrisonmhealey@gmail.com>2015-09-22 13:53:43 -0400
commitffe34aa1544172b42658cd628cdcc4036d6ff403 (patch)
tree26cd9e9b9084b999327f52127b5a3be7593d6e3e /web/react/utils/text_formatting.jsx
parente9a2c223f2f247a773d04c4c23417393ca75b3dc (diff)
downloadchat-ffe34aa1544172b42658cd628cdcc4036d6ff403.tar.gz
chat-ffe34aa1544172b42658cd628cdcc4036d6ff403.tar.bz2
chat-ffe34aa1544172b42658cd628cdcc4036d6ff403.zip
Restored changes which remove emojify and switch to our own version
Diffstat (limited to 'web/react/utils/text_formatting.jsx')
-rw-r--r--web/react/utils/text_formatting.jsx6
1 files changed, 6 insertions, 0 deletions
diff --git a/web/react/utils/text_formatting.jsx b/web/react/utils/text_formatting.jsx
index 4e390f708..be82f7b9c 100644
--- a/web/react/utils/text_formatting.jsx
+++ b/web/react/utils/text_formatting.jsx
@@ -3,6 +3,7 @@
const Autolinker = require('autolinker');
const Constants = require('./constants.jsx');
+const Emoticons = require('./emoticons.jsx');
const Markdown = require('./markdown.jsx');
const UserStore = require('../stores/user_store.jsx');
const Utils = require('./utils.jsx');
@@ -17,6 +18,7 @@ const markdownRenderer = new Markdown.MattermostMarkdownRenderer();
// - searchTerm - If specified, this word is highlighted in the resulting html. Defaults to nothing.
// - mentionHighlight - Specifies whether or not to highlight mentions of the current user. Defaults to true.
// - singleline - Specifies whether or not to remove newlines. Defaults to false.
+// - emoticons - Enables emoticon parsing. Defaults to true.
// - markdown - Enables markdown parsing. Defaults to true.
export function formatText(text, options = {}) {
if (!('markdown' in options)) {
@@ -34,6 +36,10 @@ export function formatText(text, options = {}) {
const tokens = new Map();
// replace important words and phrases with tokens
+ if (!('emoticons' in options) || options.emoticon) {
+ output = Emoticons.handleEmoticons(output, tokens);
+ }
+
output = autolinkUrls(output, tokens, !!options.markdown);
output = autolinkAtMentions(output, tokens);
output = autolinkHashtags(output, tokens);