Tighten "has" filter operator

We now require the field not to be an empty string in order to be
counted.
print-window-tiddler
Jermolene 2014-01-20 08:59:01 +00:00
rodzic 4f5a923ca0
commit 1c283c5586
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -21,7 +21,7 @@ exports.has = function(source,operator,options) {
function checkTiddler(title) {
var tiddler = options.wiki.getTiddler(title);
if(tiddler) {
var match = $tw.utils.hop(tiddler.fields,operator.operand);
var match = $tw.utils.hop(tiddler.fields,operator.operand) && tiddler.fields[operator.operand] !== "";
if(operator.prefix === "!") {
match = !match;
}