diff --git a/core/modules/filters/title.js b/core/modules/filters/title.js index 174c324cd..228676da4 100644 --- a/core/modules/filters/title.js +++ b/core/modules/filters/title.js @@ -16,7 +16,8 @@ exports.title = function(source,operator,options) { var results = []; if(operator.prefix === "!") { source(function(tiddler,title) { - if(tiddler && tiddler.fields.title !== operator.operand) { + var titleList = operator.multiValueOperands[0] || []; + if(tiddler && titleList.indexOf(tiddler.fields.title) === -1) { results.push(title); } }); diff --git a/editions/test/tiddlers/tests/data/multi-valued-variables/MultiValuedNegatedTitle.tid b/editions/test/tiddlers/tests/data/multi-valued-variables/MultiValuedNegatedTitle.tid new file mode 100644 index 000000000..576efdade --- /dev/null +++ b/editions/test/tiddlers/tests/data/multi-valued-variables/MultiValuedNegatedTitle.tid @@ -0,0 +1,18 @@ +title: MultiValuedVariables/NegatedTitle +description: Multi-valued operands +type: text/vnd.tiddlywiki-multiple +tags: [[$:/tags/wiki-test-spec]] + +title: Output + +<$let + exclude={{{ $:/core Output }}} +> +<$text text={{{ [all[tiddlers]!title(exclude)] +[join[-]] }}}/> + ++ +title: ExpectedResult + +

+ExpectedResult +

\ No newline at end of file diff --git a/editions/tw5.com/tiddlers/filters/title.tid b/editions/tw5.com/tiddlers/filters/title.tid index 3bb59d73f..45f4eb93d 100644 --- a/editions/tw5.com/tiddlers/filters/title.tid +++ b/editions/tw5.com/tiddlers/filters/title.tid @@ -16,4 +16,6 @@ op-neg-output: the input, but with tiddler <<.place T>> filtered out if it exist <<.op title>> is a [[constructor|Selection Constructors]] (except in the form `!title`), but <<.olink2 "field:title" field>> is a [[modifier|Selection Constructors]]. +<<.from-version "5.3.7">> If the operand is quoted with round brackets then the <<.op title>> operator returns the complete list of titles assigned to the multi-valued variable. When negated, the title operator with multi-valued operands returns all the titles that are not present in the operand list. + <<.operator-examples "title">>