1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-02-07 22:50:02 +00:00

Fixed search bug

This commit is contained in:
Jeremy Ruston 2012-10-18 18:27:58 +01:00
parent cd04fa22c6
commit 971bc68163

View File

@ -647,13 +647,9 @@ exports.search = function(text,options) {
if(contentTypeInfo ? contentTypeInfo.encoding === "utf8" : true) { if(contentTypeInfo ? contentTypeInfo.encoding === "utf8" : true) {
var match = true; var match = true;
for(var t=0; t<searchTermsRegExps.length; t++) { for(var t=0; t<searchTermsRegExps.length; t++) {
// Search body // Search title and body
if(match) { if(match) {
match = searchTermsRegExps[t].test(tiddler.fields.text); match = searchTermsRegExps[t].test(tiddler.fields.title) || searchTermsRegExps[t].test(tiddler.fields.text);
}
// Search title
if(match) {
match = searchTermsRegExps[t].test(tiddler.fields.title);
} }
} }
return options.invert ? !match : match; return options.invert ? !match : match;