1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-06-30 01:03:16 +00:00

Allow [title[Blah]] to match missing tiddlers

Fixes #404
This commit is contained in:
Jermolene 2014-02-12 16:01:20 +00:00
parent 01fa82fac1
commit 8b3bfa6805

View File

@ -17,13 +17,14 @@ Export our filter function
*/
exports.field = function(source,operator,options) {
var results = [],
fieldname = (operator.suffix || operator.operator).toLowerCase();
fieldname = (operator.suffix || operator.operator).toLowerCase(),
isTitle = fieldname === "title";
// Function to check an individual title
function checkTiddler(title) {
var tiddler = options.wiki.getTiddler(title);
if(tiddler) {
var match,
text = tiddler.getFieldString(fieldname);
var tiddler = options.wiki.getTiddler(title),
text = tiddler ? tiddler.getFieldString(fieldname) : (isTitle ? title : null),
match;
if(text !== null) {
if(operator.regexp) {
match = !!operator.regexp.exec(text);
} else {