1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-07-02 02:03:14 +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) { exports.field = function(source,operator,options) {
var results = [], var results = [],
fieldname = (operator.suffix || operator.operator).toLowerCase(); fieldname = (operator.suffix || operator.operator).toLowerCase(),
isTitle = fieldname === "title";
// Function to check an individual title // Function to check an individual title
function checkTiddler(title) { function checkTiddler(title) {
var tiddler = options.wiki.getTiddler(title); var tiddler = options.wiki.getTiddler(title),
if(tiddler) { text = tiddler ? tiddler.getFieldString(fieldname) : (isTitle ? title : null),
var match, match;
text = tiddler.getFieldString(fieldname); if(text !== null) {
if(operator.regexp) { if(operator.regexp) {
match = !!operator.regexp.exec(text); match = !!operator.regexp.exec(text);
} else { } else {