lib/sdoc/generator/template/shtml/resources/js/searchdoc.js in voloko-sdoc-0.1.3 vs lib/sdoc/generator/template/shtml/resources/js/searchdoc.js in voloko-sdoc-0.1.4
- old
+ new
@@ -203,12 +203,13 @@
};
return true;
}
function matchPassRegexp(index, longIndex, queries, regexps) {
- for (var i=0, l = regexps.length; i < l; i++) {
- if (!index.match(regexps[i]) && (i == 0 || !longIndex.indexOf(regexps[i]))) return false;
+ if (!index.match(regexps[0])) return false;
+ for (var i=1, l = regexps.length; i < l; i++) {
+ if (!index.match(regexps[i]) && !longIndex.match(regexps[i])) return false;
};
return true;
}
@@ -265,10 +266,10 @@
while (state.pass < 3 && state.limit > 0 && togo > 0) {
if (state.pass == 0) {
matchFunc = matchPass1;
hltFunc = highlightQuery;
} else if (state.pass == 1) {
- matchFunc = matchPass1;
+ matchFunc = matchPass2;
hltFunc = highlightQuery;
} else if (state.pass == 2) {
matchFunc = matchPassRegexp;
hltFunc = highlightRegexp;
}