summaryrefslogtreecommitdiffstats
path: root/web/react/utils/markdown.jsx
diff options
context:
space:
mode:
Diffstat (limited to 'web/react/utils/markdown.jsx')
-rw-r--r--web/react/utils/markdown.jsx8
1 files changed, 5 insertions, 3 deletions
diff --git a/web/react/utils/markdown.jsx b/web/react/utils/markdown.jsx
index 880e41a18..8c63810cd 100644
--- a/web/react/utils/markdown.jsx
+++ b/web/react/utils/markdown.jsx
@@ -5,10 +5,12 @@ const marked = require('marked');
export class MattermostMarkdownRenderer extends marked.Renderer {
link(href, title, text) {
- if (href.lastIndexOf('http', 0) !== 0) {
- href = `http://${href}`;
+ let outHref = href;
+
+ if (outHref.lastIndexOf('http', 0) !== 0) {
+ outHref = `http://${outHref}`;
}
- return super.link(href, title, text);
+ return super.link(outHref, title, text);
}
}