Fix highlight not working after first highlight insert #1098 by skimi · Pull Request #1099 · selectize/selectize.js
The highlight did not work correctly after the first highlight happened. Most likely it would only highlight the first letter.
Newer version of the highlight function have added a removeHighlight() function that allows to reset the strings between each highlights and then getting a good result.
Problem, that version does not use Regexp to match the highlight anymore and their file does not pass the strict mode as is so it can't be commited to selectize.
It's a bit weird to have that contrib commited into the repo. I don't know if it's wise to edit it in our code or not or to update it or to remove it, or... So I've just made the minimal changes to fix the issue without changing much. I've copied their removeHighlight() fn and edited it to pass strict mode.
From issue #1098