Make linkify links open in new tab/window
I believe this behavior is more appropriate.
This commit is contained in:
@@ -100,7 +100,7 @@
|
|||||||
var startsWithProtocol = new RegExp('^' + protocolClause),
|
var startsWithProtocol = new RegExp('^' + protocolClause),
|
||||||
urlHasProtocol = url.match(startsWithProtocol),
|
urlHasProtocol = url.match(startsWithProtocol),
|
||||||
href = (urlHasProtocol) ? url : 'http://' + url,
|
href = (urlHasProtocol) ? url : 'http://' + url,
|
||||||
link = '<a href="' + href + '" >' + url + '</a>',
|
link = '<a href="' + href + '" target="_blank">' + url + '</a>',
|
||||||
newHTML = nodeHTML.replace(url, link);
|
newHTML = nodeHTML.replace(url, link);
|
||||||
|
|
||||||
line.innerHTML = line.innerHTML.replace(nodeHTML, newHTML);
|
line.innerHTML = line.innerHTML.replace(nodeHTML, newHTML);
|
||||||
|
|||||||
Reference in New Issue
Block a user