Make linkify links open in new tab/window

I believe this behavior is more appropriate.
This commit is contained in:
Tine Jozelj
2016-08-02 15:57:15 +02:00
committed by GitHub
parent d2cef6f29d
commit 3113cdf0ea
+1 -1
View File
@@ -100,7 +100,7 @@
var startsWithProtocol = new RegExp('^' + protocolClause),
urlHasProtocol = url.match(startsWithProtocol),
href = (urlHasProtocol) ? url : 'http://' + url,
link = '<a href="' + href + '" >' + url + '</a>',
link = '<a href="' + href + '" target="_blank">' + url + '</a>',
newHTML = nodeHTML.replace(url, link);
line.innerHTML = line.innerHTML.replace(nodeHTML, newHTML);