diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index bef0d95a8..541cb2a49 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -4525,7 +4525,7 @@ return range; }, makeLink: function(range) { - var a, char, len, text, trim; + var a, char, text, trim; text = range.toString(); trim = function() { @@ -4540,7 +4540,7 @@ range.setStart(range.startContainer, range.startOffset + 1); } } - while (/[)\]}>.,]/.test(char = text.charAt((len = text.length) - 1))) { + while (/[)\]}>.,]/.test(char = text.charAt(text.length - 1))) { if (/[.,]/.test(char) || (text.match(/[()\[\]{}<>]/g)).length % 2) { trim(); continue; diff --git a/builds/crx/script.js b/builds/crx/script.js index 910049a46..c8a4bfa47 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -4531,7 +4531,7 @@ return range; }, makeLink: function(range) { - var a, char, len, text, trim; + var a, char, text, trim; text = range.toString(); trim = function() { @@ -4546,7 +4546,7 @@ range.setStart(range.startContainer, range.startOffset + 1); } } - while (/[)\]}>.,]/.test(char = text.charAt((len = text.length) - 1))) { + while (/[)\]}>.,]/.test(char = text.charAt(text.length - 1))) { if (/[.,]/.test(char) || (text.match(/[()\[\]{}<>]/g)).length % 2) { trim(); continue; diff --git a/src/Linkification/Linkify.coffee b/src/Linkification/Linkify.coffee index a5fa64f5c..5593e6bb5 100644 --- a/src/Linkification/Linkify.coffee +++ b/src/Linkification/Linkify.coffee @@ -117,12 +117,13 @@ Linkify = range.setStart range.startContainer, range.startOffset + 1 # Clean hanging brackets, commas, periods - while /[)\]}>.,]/.test char = text.charAt (len = text.length) - 1 + while /[)\]}>.,]/.test char = text.charAt text.length - 1 if /[.,]/.test(char) or (text.match /[()\[\]{}<>]/g).length % 2 trim() continue break + # This is the only piece of code left based on Anthony Lieuallen's Linkify text = if text.contains ':' text