mirror of
https://codeberg.org/emersion/gamja.git
synced 2024-11-28 02:05:41 -05:00
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
1 changed files with 5 additions and 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("://");
|
||||
|
|
Loading…
Reference in a new issue