kopia lustrzana https://github.com/miklobit/TiddlyWiki5
Adjust field and has filter handling of missing tiddlers
Now `[!field:name[value]]` and `[!has[name]` will treat missing tiddlers as not having the specified fieldprint-window-tiddler
rodzic
156d3bc692
commit
42dba113cc
|
@ -26,6 +26,8 @@ exports.field = function(source,operator,options) {
|
|||
if(text !== null && !operator.regexp.exec(text)) {
|
||||
results.push(title);
|
||||
}
|
||||
} else {
|
||||
results.push(title);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
|
@ -35,6 +37,8 @@ exports.field = function(source,operator,options) {
|
|||
if(text !== null && text !== operator.operand) {
|
||||
results.push(title);
|
||||
}
|
||||
} else {
|
||||
results.push(title);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@ exports.has = function(source,operator,options) {
|
|||
var results = [];
|
||||
if(operator.prefix === "!") {
|
||||
source(function(tiddler,title) {
|
||||
if(tiddler && (!$tw.utils.hop(tiddler.fields,operator.operand) || tiddler.fields[operator.operand] === "")) {
|
||||
if(!tiddler || (tiddler && (!$tw.utils.hop(tiddler.fields,operator.operand) || tiddler.fields[operator.operand] === ""))) {
|
||||
results.push(title);
|
||||
}
|
||||
});
|
||||
|
|
Ładowanie…
Reference in New Issue