From 40c47dcf0b85658198e369b7daf33302d26a3384 Mon Sep 17 00:00:00 2001 From: Harrison Healey Date: Tue, 19 Jul 2016 08:28:29 -0400 Subject: Rendered invalid URLs as plain text when parsing markdown (#3616) --- webapp/utils/markdown.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'webapp/utils') diff --git a/webapp/utils/markdown.jsx b/webapp/utils/markdown.jsx index bd1e998b4..e291ce546 100644 --- a/webapp/utils/markdown.jsx +++ b/webapp/utils/markdown.jsx @@ -139,10 +139,10 @@ class MattermostMarkdownRenderer extends marked.Renderer { const unescaped = decodeURIComponent(unescape(href)).replace(/[^\w:]/g, '').toLowerCase(); if (unescaped.indexOf('javascript:') === 0 || unescaped.indexOf('vbscript:') === 0 || unescaped.indexOf('data:') === 0) { // eslint-disable-line no-script-url - return ''; + return text; } } catch (e) { - return ''; + return text; } if (!(/[a-z+.-]+:/i).test(outHref)) { -- cgit v1.2.3-1-g7c22