forked from CringeStudios/gamja
lib/irc: fix bound check in isHighlight
Doesn't seem like this was causing any issues, but let's fix the logic regardless.
This commit is contained in:
parent
221b1b6356
commit
e37d5f363b
@ -298,7 +298,7 @@ export function isHighlight(msg, nick, cm) {
|
||||
if (i > 0) {
|
||||
left = text[i - 1];
|
||||
}
|
||||
if (i < text.length) {
|
||||
if (i + nick.length < text.length) {
|
||||
right = text[i + nick.length];
|
||||
}
|
||||
if (isWordBoundary(left) && isWordBoundary(right)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user