Prepend http protocol to www. links in chat

Fixes #406
This commit is contained in:
Pavel Djundik 2016-06-16 17:40:02 +03:00 committed by GitHub
parent 82618a2f19
commit a94b9623f9

View File

@ -14,7 +14,7 @@ function uri(text) {
return url; return url;
} }
var split = url.split("<"); var split = url.split("<");
url = "<a href='" + split[0].replace(/^www/, "//www") + "' target='_blank' rel='noopener'>" + split[0] + "</a>"; url = "<a href='" + split[0].replace(/^www/, "http://www") + "' target='_blank' rel='noopener'>" + split[0] + "</a>";
if (split.length > 1) { if (split.length > 1) {
url += "<" + split.slice(1).join("<"); url += "<" + split.slice(1).join("<");
} }