Merge pull request #410 from thelounge/xpaw/url-protocol

Prepend http protocol to www. links in chat
This commit is contained in:
Max-P 2016-06-16 17:02:34 -04:00 committed by GitHub
commit 1c6c19fea5

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("<");
} }