forked from CringeStudios/gamja
lib/irc: fix whitespace RegExp test in isURIPrefix
This commit is contained in:
parent
c1c7c91c38
commit
3584c1eb10
@ -264,7 +264,7 @@ const alphaNum = (() => {
|
|||||||
return new RegExp(/^[a-zA-Z0-9]$/, "u");
|
return new RegExp(/^[a-zA-Z0-9]$/, "u");
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
const space = new RegExp(/\s/);
|
const space = new RegExp(/^\s$/);
|
||||||
|
|
||||||
function isWordBoundary(ch) {
|
function isWordBoundary(ch) {
|
||||||
switch (ch) {
|
switch (ch) {
|
||||||
@ -279,7 +279,7 @@ function isWordBoundary(ch) {
|
|||||||
|
|
||||||
function isURIPrefix(text) {
|
function isURIPrefix(text) {
|
||||||
for (let i = text.length - 1; i >= 0; i--) {
|
for (let i = text.length - 1; i >= 0; i--) {
|
||||||
if (text[i].search(space)) {
|
if (space.test(text[i])) {
|
||||||
text = text.slice(i);
|
text = text.slice(i);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user