diff --git a/builds/appchan-x.user.js b/builds/appchan-x.user.js index 4d0b8923f..95040c1a7 100644 --- a/builds/appchan-x.user.js +++ b/builds/appchan-x.user.js @@ -6653,13 +6653,13 @@ range = document.createRange(); range.setStart(node, len2 = data.indexOf(link)); range.setEnd(node, len2 + link.length); - post.nodes.links.push(Linkify.makeLink(range)); + Linkify.makeLink(range, post); } range = document.createRange(); range.setStart(node, len = data.indexOf(link)); if ((data.length - (len += link.length)) > 0) { range.setEnd(node, len); - post.nodes.links.push(Linkify.makeLink(range)); + Linkify.makeLink(range, post); return; } while ((next = node.nextSibling) && next.nodeName.toLowerCase() !== 'br') { @@ -6675,9 +6675,9 @@ } range.setEnd(node, node.length); } - post.nodes.links.push(Linkify.makeLink(range)); + Linkify.makeLink(range, post); }, - makeLink: function(range) { + makeLink: function(range, post) { var a, link; link = range.toString(); @@ -6689,7 +6689,7 @@ href: link }); range.surroundContents(a); - return a; + post.nodes.links.push(a); }, services: function(link) { var href, key, match, type, _ref; diff --git a/builds/crx/script.js b/builds/crx/script.js index 05e52c410..b4c810db4 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -6656,13 +6656,13 @@ range = document.createRange(); range.setStart(node, len2 = data.indexOf(link)); range.setEnd(node, len2 + link.length); - post.nodes.links.push(Linkify.makeLink(range)); + Linkify.makeLink(range, post); } range = document.createRange(); range.setStart(node, len = data.indexOf(link)); if ((data.length - (len += link.length)) > 0) { range.setEnd(node, len); - post.nodes.links.push(Linkify.makeLink(range)); + Linkify.makeLink(range, post); return; } while ((next = node.nextSibling) && next.nodeName.toLowerCase() !== 'br') { @@ -6678,9 +6678,9 @@ } range.setEnd(node, node.length); } - post.nodes.links.push(Linkify.makeLink(range)); + Linkify.makeLink(range, post); }, - makeLink: function(range) { + makeLink: function(range, post) { var a, link; link = range.toString(); @@ -6692,7 +6692,7 @@ href: link }); range.surroundContents(a); - return a; + post.nodes.links.push(a); }, services: function(link) { var href, key, match, type, _ref; diff --git a/src/Linkification/Linkify.coffee b/src/Linkification/Linkify.coffee index 84a1deda9..42636c3ff 100644 --- a/src/Linkification/Linkify.coffee +++ b/src/Linkification/Linkify.coffee @@ -67,14 +67,14 @@ Linkify = range = document.createRange(); range.setStart node, len2 = data.indexOf link range.setEnd node, len2 + link.length - post.nodes.links.push Linkify.makeLink range + Linkify.makeLink range, post range = document.createRange() range.setStart node, len = data.indexOf link if (data.length - (len += link.length)) > 0 range.setEnd node, len - post.nodes.links.push Linkify.makeLink range + Linkify.makeLink range, post return while (next = node.nextSibling) and next.nodeName.toLowerCase() isnt 'br' @@ -88,10 +88,10 @@ Linkify = node = node.previousSibling range.setEnd node, node.length - post.nodes.links.push Linkify.makeLink range + Linkify.makeLink range, post return - makeLink: (range) -> + makeLink: (range, post) -> link = range.toString() link = if link.contains ':' @@ -108,9 +108,9 @@ Linkify = rel: 'nofollow noreferrer' target: '_blank' href: link - range.surroundContents a - return a + post.nodes.links.push a + return services: (link) -> href = link.href