From 074b724d68a4cbe0e4b72618a0bc1b2bf7b9f7ba Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Mon, 2 Jul 2018 07:39:04 +0200 Subject: [PATCH] Made URLs detection more efficient --- assets/js/components/textParser.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/assets/js/components/textParser.js b/assets/js/components/textParser.js index 1b3850d3..0265f316 100644 --- a/assets/js/components/textParser.js +++ b/assets/js/components/textParser.js @@ -63,10 +63,10 @@ ComunicWeb.components.textParser = { _prepare_url_tag_parsing: function(target){ //Find all occurences of users tag - while(target.innerHTML.match(/ [a-zA-Z]{2,5}:\/\/[a-zA-Z0-9.=@\?\&:\/]+/i)){ + while(target.innerHTML.match(/ [a-zA-Z]{2,5}:\/\/[a-zA-Z0-9.=@\?\-\_\&\;:\/]+/i)){ //Get URL and save it - var URL = target.innerHTML.match(/ [a-zA-Z]{2,5}:\/\/[a-zA-Z0-9.=@\?\&:\/]+/i)[0]; + var URL = target.innerHTML.match(/ [a-zA-Z]{2,5}:\/\/[a-zA-Z0-9.=@\?\-\_\&\;:\/]+/i)[0]; tempURL = URL.replace("://", ":/"); target.innerHTML = target.innerHTML.replace(URL, ""+tempURL+"");