forked from CringeStudios/gamja
lib/irc: fix whitespace split in isURIPrefix
We want to get the last index of whitespace, not the first one.
This commit is contained in:
parent
5d3738bc40
commit
57f7b1c011
@ -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("://");
|
||||
|
Loading…
x
Reference in New Issue
Block a user