diff options
author | Girish S <girish.sonawane@gmail.com> | 2015-10-23 10:47:26 +0530 |
---|---|---|
committer | Girish S <girish.sonawane@gmail.com> | 2015-10-27 18:02:07 +0530 |
commit | 9de0ceb22995d9bdf9b53d620471f1dd9d8042ae (patch) | |
tree | 273c7ea8911b0e3cf346b30f18c53d3b83ade837 /web/react/utils/markdown.jsx | |
parent | 28847c6b4b864d747bbfdf5c53354dcb24e5f895 (diff) | |
download | chat-9de0ceb22995d9bdf9b53d620471f1dd9d8042ae.tar.gz chat-9de0ceb22995d9bdf9b53d620471f1dd9d8042ae.tar.bz2 chat-9de0ceb22995d9bdf9b53d620471f1dd9d8042ae.zip |
auto-link mentions with user names having symbols
this also handles the case where user_name having '_'
Diffstat (limited to 'web/react/utils/markdown.jsx')
-rw-r--r-- | web/react/utils/markdown.jsx | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/web/react/utils/markdown.jsx b/web/react/utils/markdown.jsx index 01cc309b8..ad11a95ac 100644 --- a/web/react/utils/markdown.jsx +++ b/web/react/utils/markdown.jsx @@ -121,8 +121,11 @@ export class MattermostMarkdownRenderer extends marked.Renderer { paragraph(text) { let outText = text; + // required so markdown does not strip '_' from @user_names + outText = TextFormatting.doFormatMentions(text); + if (!('emoticons' in this.options) || this.options.emoticon) { - outText = TextFormatting.doFormatEmoticons(text); + outText = TextFormatting.doFormatEmoticons(outText); } if (this.formattingOptions.singleline) { @@ -136,7 +139,7 @@ export class MattermostMarkdownRenderer extends marked.Renderer { return `<table class="markdown__table"><thead>${header}</thead><tbody>${body}</tbody></table>`; } - text(text) { - return TextFormatting.doFormatText(text, this.formattingOptions); + text(txt) { + return TextFormatting.doFormatText(txt, this.formattingOptions); } } |