diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index 9916f84e2..bef0d95a8 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -4541,7 +4541,7 @@ } } while (/[)\]}>.,]/.test(char = text.charAt((len = text.length) - 1))) { - if (/[.,]/.test(char) || (text.match(/[()\[\]{}<>]/)).length % 2) { + if (/[.,]/.test(char) || (text.match(/[()\[\]{}<>]/g)).length % 2) { trim(); continue; } diff --git a/builds/crx/script.js b/builds/crx/script.js index 1b4513959..910049a46 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -4547,7 +4547,7 @@ } } while (/[)\]}>.,]/.test(char = text.charAt((len = text.length) - 1))) { - if (/[.,]/.test(char) || (text.match(/[()\[\]{}<>]/)).length % 2) { + if (/[.,]/.test(char) || (text.match(/[()\[\]{}<>]/g)).length % 2) { trim(); continue; } diff --git a/src/Linkification/Linkify.coffee b/src/Linkification/Linkify.coffee index ea7c3c902..a5fa64f5c 100644 --- a/src/Linkification/Linkify.coffee +++ b/src/Linkification/Linkify.coffee @@ -118,7 +118,7 @@ Linkify = # Clean hanging brackets, commas, periods while /[)\]}>.,]/.test char = text.charAt (len = text.length) - 1 - if /[.,]/.test(char) or (text.match /[()\[\]{}<>]/).length % 2 + if /[.,]/.test(char) or (text.match /[()\[\]{}<>]/g).length % 2 trim() continue break