From 9eda79c24c8b566200c16b8790217e6d61d118ce Mon Sep 17 00:00:00 2001 From: Zixaphir Date: Mon, 5 Aug 2013 00:05:02 -0700 Subject: [PATCH] Fix Linkify in Chrome Was skipping every other URL if they were on trailing lines --- builds/4chan-X.user.js | 3 ++- builds/crx/script.js | 3 ++- src/Linkification/Linkify.coffee | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index 407f59774..f5ce94ae5 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -18,7 +18,7 @@ // @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAgMAAAAqbBEUAAAACVBMVEUAAGcAAABmzDNZt9VtAAAAAXRSTlMAQObYZgAAAHFJREFUKFOt0LENACEIBdBv4Qju4wgWanEj3D6OcIVMKaitYHEU/jwTCQj8W75kiVCSBvdQ5/AvfVHBin11BgdRq3ysBgfwBDRrj3MCIA+oAQaku/Q1cNctrAmyDl577tOThYt/Y1RBM4DgOHzM0HFTAyLukH/cmRnqAAAAAElFTkSuQmCC // ==/UserScript== /* -* 4chan X - Version 1.2.25 - 2013-08-04 +* 4chan X - Version 1.2.25 - 2013-08-05 * * Licensed under the MIT license. * https://github.com/seaweedchan/4chan-x/blob/master/LICENSE @@ -4368,6 +4368,7 @@ range.setEnd(node, len2); links.push(range); } + Linkify.regString.lastIndex = 0; if (match) { Linkify.seek(match, node, post); } diff --git a/builds/crx/script.js b/builds/crx/script.js index 2c177fdce..8fd0d325e 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -1,6 +1,6 @@ // Generated by CoffeeScript /* -* 4chan X - Version 1.2.25 - 2013-08-04 +* 4chan X - Version 1.2.25 - 2013-08-05 * * Licensed under the MIT license. * https://github.com/seaweedchan/4chan-x/blob/master/LICENSE @@ -4373,6 +4373,7 @@ range.setEnd(node, len2); links.push(range); } + Linkify.regString.lastIndex = 0; if (match) { Linkify.seek(match, node, post); } diff --git a/src/Linkification/Linkify.coffee b/src/Linkification/Linkify.coffee index 599a11245..c32ec484e 100644 --- a/src/Linkification/Linkify.coffee +++ b/src/Linkification/Linkify.coffee @@ -76,6 +76,8 @@ Linkify = range.setEnd node, len2 links.push range + Linkify.regString.lastIndex = 0 + if match Linkify.seek match, node, post