highlight case insensitively

This commit is contained in:
Matthew Hodgson 2015-12-28 03:14:50 +00:00
parent 970bc84bb6
commit 15f19be408

View file

@ -69,7 +69,7 @@ class Highlighter {
// HTML and plain-text highlighting.
var safeHighlight = this.html ? sanitizeHtml(highlights[0], sanitizeHtmlParams) : highlights[0];
while ((offset = safeSnippet.indexOf(safeHighlight, lastOffset)) >= 0) {
while ((offset = safeSnippet.toLowerCase().indexOf(safeHighlight.toLowerCase(), lastOffset)) >= 0) {
// handle preamble
if (offset > lastOffset) {
var subSnippet = safeSnippet.substring(lastOffset, offset);