1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-26 19:47:20 +00:00

Search over tags as well as the title and text fields

This commit is contained in:
Jeremy Ruston 2013-10-11 08:46:09 +01:00
parent 27f724d0ed
commit d3d72eff1b

View File

@ -754,7 +754,8 @@ exports.search = function(text,options) {
for(var t=0; t<searchTermsRegExps.length; t++) { for(var t=0; t<searchTermsRegExps.length; t++) {
// Search title and body // Search title and body
if(match) { if(match) {
match = searchTermsRegExps[t].test(tiddler.fields.title) || searchTermsRegExps[t].test(tiddler.fields.text); var tags = tiddler.fields.tags ? tiddler.fields.tags.join("\0") : "";
match = searchTermsRegExps[t].test(tiddler.fields.title) || searchTermsRegExps[t].test(tags) || searchTermsRegExps[t].test(tiddler.fields.text);
} }
} }
return options.invert ? !match : match; return options.invert ? !match : match;