From 42c4937dfbacffe18b35d4b872967ea1f693d560 Mon Sep 17 00:00:00 2001 From: Zixaphir Date: Wed, 14 Aug 2013 02:01:44 -0700 Subject: [PATCH] Fix range.endOffset in inline links that end before node.length --- builds/4chan-X.user.js | 2 +- builds/crx/script.js | 2 +- src/Linkification/Linkify.coffee | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index a96fb7101..ed4013ae5 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -4489,7 +4489,7 @@ break; } else { if (link = Linkify.regString.exec(result[0])) { - range = Linkify.makeRange(node, node, index + link.index, length + link.index); + range = Linkify.makeRange(node, node, index + link.index, length); links.push(range); } } diff --git a/builds/crx/script.js b/builds/crx/script.js index 2698cabb2..3f1a9fe66 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -4495,7 +4495,7 @@ break; } else { if (link = Linkify.regString.exec(result[0])) { - range = Linkify.makeRange(node, node, index + link.index, length + link.index); + range = Linkify.makeRange(node, node, index + link.index, length); links.push(range); } } diff --git a/src/Linkification/Linkify.coffee b/src/Linkification/Linkify.coffee index 95abcd949..a82258fdb 100644 --- a/src/Linkification/Linkify.coffee +++ b/src/Linkification/Linkify.coffee @@ -80,7 +80,7 @@ Linkify = else if link = Linkify.regString.exec result[0] - range = Linkify.makeRange node, node, index + link.index, length + link.index + range = Linkify.makeRange node, node, index + link.index, length links.push range for range in links.reverse()