diff options
author | Simon Ser <contact@emersion.fr> | 2024-03-07 11:40:37 +0100 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2024-03-07 11:40:37 +0100 |
commit | 57f7b1c0118d2cd02fda547451f8ab489b6a921f (patch) | |
tree | de632d53d36b741e399d468ee68df001a8770aad | |
parent | 5d3738bc40f9e4cb275146f762b3ec9de9492ce0 (diff) | |
download | gamja-57f7b1c0118d2cd02fda547451f8ab489b6a921f.tar.gz gamja-57f7b1c0118d2cd02fda547451f8ab489b6a921f.zip |
lib/irc: fix whitespace split in isURIPrefix
We want to get the last index of whitespace, not the first one.
-rw-r--r-- | lib/irc.js | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -278,9 +278,11 @@ function isWordBoundary(ch) { } function isURIPrefix(text) { - let i = text.search(space); - if (i >= 0) { - text = text.slice(i); + for (let i = text.length - 1; i >= 0; i--) { + if (text[i].search(space)) { + text = text.slice(i); + break; + } } i = text.indexOf("://"); |