diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index c0e3dc531..8e0b17e34 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -4547,7 +4547,7 @@ } if (i) { text = text.slice(0, -i); - while (range.endOffset > i) { + while (range.endOffset - i < 0) { i--; } if (i) { diff --git a/builds/crx/script.js b/builds/crx/script.js index 3973a6a70..3dd87943f 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -4556,7 +4556,7 @@ } if (i) { text = text.slice(0, -i); - while (range.endOffset > i) { + while (range.endOffset - i < 0) { i--; } if (i) { diff --git a/src/Linkification/Linkify.coffee b/src/Linkification/Linkify.coffee index 23f8c2b5e..dbc759a00 100755 --- a/src/Linkification/Linkify.coffee +++ b/src/Linkification/Linkify.coffee @@ -124,7 +124,7 @@ Linkify = if i text = text.slice 0, -i - i-- while range.endOffset > i + i-- while range.endOffset - i < 0 if i range.setEnd range.endContainer, range.endOffset - i