Fix: add a warning

This commit is contained in:
eight 2018-11-07 21:40:28 +08:00
parent 66967844c4
commit d4eee828a0

View File

@ -225,6 +225,8 @@
if (typeof needle === 'string') {
return s.indexOf(needle);
}
// FIXME: the current implementation will break when the highlighter addon
// is updated.
const match = s.match(needle);
return match ? match.index + match[1].length : -1;
}