diff --git a/core/modules/filters/each.js b/core/modules/filters/each.js index c60447446..25e852638 100644 --- a/core/modules/filters/each.js +++ b/core/modules/filters/each.js @@ -20,7 +20,7 @@ exports.each = function(source,operator,options) { var results =[] , value,values = {}, field = operator.operand || "title"; - if(operator.suffix !== "list") { + if(operator.suffix !== "list-item") { source(function(tiddler,title) { if(tiddler) { value = (field === "title") ? title : tiddler.getFieldString(field); diff --git a/editions/test/tiddlers/tests/test-filters.js b/editions/test/tiddlers/tests/test-filters.js index 1b16b117c..2af6c2e36 100644 --- a/editions/test/tiddlers/tests/test-filters.js +++ b/editions/test/tiddlers/tests/test-filters.js @@ -219,8 +219,8 @@ describe("Filter tests", function() { it("should handle the each operator", function() { expect(wiki.filterTiddlers("[each[modifier]sort[title]]").join(",")).toBe("$:/TiddlerTwo,TiddlerOne"); - expect(wiki.filterTiddlers("[each:list[tags]sort[title]]").join(",")).toBe("one,two"); - expect(wiki.filterTiddlers("[each:list[authors]sort[title]]").join(",")).toBe("Bloggs,Joe,John Doe"); + expect(wiki.filterTiddlers("[each:list-item[tags]sort[title]]").join(",")).toBe("one,two"); + expect(wiki.filterTiddlers("[each:list-item[authors]sort[title]]").join(",")).toBe("Bloggs,Joe,John Doe"); }); it("should handle the eachday operator", function() { diff --git a/editions/tw5.com/tiddlers/filters/each.tid b/editions/tw5.com/tiddlers/filters/each.tid index 09b69fa70..8a48fb122 100644 --- a/editions/tw5.com/tiddlers/filters/each.tid +++ b/editions/tw5.com/tiddlers/filters/each.tid @@ -6,7 +6,7 @@ type: text/vnd.tiddlywiki caption: each op-purpose: select one of each group of input titles by field op-input: a [[selection of titles|Title Selection]] -op-suffix: optionally, `list` +op-suffix: optionally, `list-item` op-parameter: the name of a [[field|TiddlerFields]], defaulting to <<.field title>> op-parameter-name: F op-output: a selection containing the first input title encountered for each distinct value of field <<.place F>> @@ -15,7 +15,7 @@ Each input title is processed in turn. The value of field <<.place F>> in the co ;each :As long as the field's value has not been encountered before, the title is appended to the output. -;each:list +;each:list-item :The value is treated as a [[title list|Title List]]. Each title in the list considered in turn. If it has not been encountered before, it is appended to the output. If a tiddler doesn't contain field <<.place F>>, it is treated as if the field's value was empty. diff --git a/editions/tw5.com/tiddlers/filters/examples/each.tid b/editions/tw5.com/tiddlers/filters/examples/each.tid index 091e1bc37..f6e2ed23b 100644 --- a/editions/tw5.com/tiddlers/filters/examples/each.tid +++ b/editions/tw5.com/tiddlers/filters/examples/each.tid @@ -6,6 +6,6 @@ type: text/vnd.tiddlywiki <<.operator-example 1 "[each[color]]">> <<.operator-example 2 "[sort[title]each[type]]" "the alphabetically first tiddler of each type">> -<<.operator-example 3 "[each:list[list]]" "all tiddlers listed anywhere in the core list field">> +<<.operator-example 3 "[each:list-item[list]]" "all tiddlers listed anywhere in the core list field">> For an example of using the <<.op each>> operator to generate a two-tier list of groups and members, see [[GroupedLists]].