mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-07-05 03:22:51 +00:00
Seach titles as well as bodies
This commit is contained in:
parent
1a88a12eb5
commit
10ed746209
@ -635,9 +635,14 @@ 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
|
||||||
if(match) {
|
if(match) {
|
||||||
match = searchTermsRegExps[t].test(tiddler.fields.text);
|
match = 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;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user