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) {
|
function isURIPrefix(text) {
|
||||||
let i = text.search(space);
|
for (let i = text.length - 1; i >= 0; i--) {
|
||||||
if (i >= 0) {
|
if (text[i].search(space)) {
|
||||||
text = text.slice(i);
|
text = text.slice(i);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
i = text.indexOf("://");
|
i = text.indexOf("://");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user