From db1ed0e66b019b4fbfc04268aa899718ed1312f0 Mon Sep 17 00:00:00 2001 From: Jeremy Ruston Date: Sat, 8 Mar 2025 09:00:32 +0000 Subject: [PATCH] Fix tests --- core/modules/filterrunprefixes/let.js | 4 +++- .../tw5.com/tiddlers/filters/syntax/Let Filter Run Prefix.tid | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/core/modules/filterrunprefixes/let.js b/core/modules/filterrunprefixes/let.js index 0cb9a7ae9..e8218bab4 100644 --- a/core/modules/filterrunprefixes/let.js +++ b/core/modules/filterrunprefixes/let.js @@ -20,9 +20,11 @@ exports.let = function(operationSubFunction,options) { var name = options.suffixes[0][0]; // Return the filter run prefix function return function(results,source,widget) { + // Set the input source to the incoming results + var inputSource = widget.wiki.makeTiddlerIterator(results.toArray()); // Assign the result of the subfunction to the variable var variables = {}; - variables[name] = operationSubFunction(source,widget)[0] || ""; + variables[name] = operationSubFunction(inputSource,widget)[0] || ""; // Clear the results results.clear(); // Return the variables diff --git a/editions/tw5.com/tiddlers/filters/syntax/Let Filter Run Prefix.tid b/editions/tw5.com/tiddlers/filters/syntax/Let Filter Run Prefix.tid index fc8480190..ed8b6bffc 100644 --- a/editions/tw5.com/tiddlers/filters/syntax/Let Filter Run Prefix.tid +++ b/editions/tw5.com/tiddlers/filters/syntax/Let Filter Run Prefix.tid @@ -20,4 +20,4 @@ type: text/vnd.tiddlywiki The `:let` filter run prefix assigns the first result of a filter run to a variable that is made available to the remaining [[filter runs|Filter Run]] in the [[filter expression|Filter Expression]]. If the filter run does not return any results then the variable is set to an empty string. -The output of the `:let` filter run prefix is an empty title list. +Within the filter run the [[all Operator]] with an empty parameter retrieves all the titles from the previous filter runs, instead of the usual behaviour of retieving all the titles that were passed to the filter expression. \ No newline at end of file