summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarrison Healey <harrisonmhealey@gmail.com>2016-06-02 18:48:43 -0400
committerenahum <nahumhbl@gmail.com>2016-06-02 19:48:43 -0300
commit0e677f35bbcd048facdc78d0e959fa2441975065 (patch)
tree78443d2471cb7ac505e2525ef9c90ed45c7b165c
parent3083d4094ca58c75b4b10270ff3bdfcacb5fa0d7 (diff)
downloadchat-0e677f35bbcd048facdc78d0e959fa2441975065.tar.gz
chat-0e677f35bbcd048facdc78d0e959fa2441975065.tar.bz2
chat-0e677f35bbcd048facdc78d0e959fa2441975065.zip
Removed hashtag/mention links that appear within text for markdown links (#3199)
-rw-r--r--webapp/utils/markdown.jsx3
1 files changed, 2 insertions, 1 deletions
diff --git a/webapp/utils/markdown.jsx b/webapp/utils/markdown.jsx
index b128bd3e8..73af4ae91 100644
--- a/webapp/utils/markdown.jsx
+++ b/webapp/utils/markdown.jsx
@@ -162,7 +162,8 @@ class MattermostMarkdownRenderer extends marked.Renderer {
output += ' title="' + title + '"';
}
- output += '>' + text + '</a>';
+ // remove any links added to the text by hashtag or mention parsing since they'll break this link
+ output += '>' + text.replace(/<\/?a[^>]*>/, '') + '</a>';
return output;
}