summaryrefslogtreecommitdiffstats
path: root/web/react/utils/markdown.jsx
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2015-09-23 08:27:12 -0400
committerChristopher Speller <crspeller@gmail.com>2015-09-23 08:27:12 -0400
commitbdd0cfd227840d55e0f0f42562135531164152bf (patch)
tree8aa1de407b051df1145bff12e7d475caf4788146 /web/react/utils/markdown.jsx
parent0391e5fe96d922f1e4a6ca2418a871ba1e88c9d2 (diff)
parent55f11ba8719d133103bc1d4779bb8cb66d591b58 (diff)
downloadchat-bdd0cfd227840d55e0f0f42562135531164152bf.tar.gz
chat-bdd0cfd227840d55e0f0f42562135531164152bf.tar.bz2
chat-bdd0cfd227840d55e0f0f42562135531164152bf.zip
Merge pull request #751 from hmhealey/plt344
PLT-344 Restore emoticon handling to text_formatting.jsx and fix it's interaction with other formatting
Diffstat (limited to 'web/react/utils/markdown.jsx')
-rw-r--r--web/react/utils/markdown.jsx13
1 files changed, 13 insertions, 0 deletions
diff --git a/web/react/utils/markdown.jsx b/web/react/utils/markdown.jsx
index 96da54217..0a876a3e3 100644
--- a/web/react/utils/markdown.jsx
+++ b/web/react/utils/markdown.jsx
@@ -1,9 +1,18 @@
// Copyright (c) 2015 Spinpunch, Inc. All Rights Reserved.
// See License.txt for license information.
+const TextFormatting = require('./text_formatting.jsx');
+
const marked = require('marked');
export class MattermostMarkdownRenderer extends marked.Renderer {
+ constructor(options, formattingOptions = {}) {
+ super(options);
+
+ this.text = this.text.bind(this);
+
+ this.formattingOptions = formattingOptions;
+ }
link(href, title, text) {
let outHref = href;
@@ -19,4 +28,8 @@ export class MattermostMarkdownRenderer extends marked.Renderer {
return output;
}
+
+ text(text) {
+ return TextFormatting.doFormatText(text, this.formattingOptions);
+ }
}