1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-04-07 11:16:55 +00:00

Get rid of the special behaviour for all[]

Not needed because the input to the filter run is available
This commit is contained in:
Jeremy Ruston 2025-03-08 08:56:12 +00:00
parent b8bdb0aeeb
commit 1acef48a10
4 changed files with 14 additions and 16 deletions

View File

@ -20,11 +20,9 @@ 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(inputSource,widget)[0] || "";
variables[name] = operationSubFunction(source,widget)[0] || "";
// Clear the results
results.clear();
// Return the variables

View File

@ -1,12 +0,0 @@
title: LetFilterRunPrefix/All
description: Usage of "all[]" operator within "let" filter run prefix
type: text/vnd.tiddlywiki-multiple
tags: [[$:/tags/wiki-test-spec]]
title: Output
<$text text={{{ [[colossus]] :let:another[all[]] [<another>] +[join[-]] }}}/>
+
title: ExpectedResult
<p>colossus</p>

View File

@ -0,0 +1,12 @@
title: LetFilterRunPrefix/UseInput
description: Using the input of "let" filter run prefix
type: text/vnd.tiddlywiki-multiple
tags: [[$:/tags/wiki-test-spec]]
title: Output
<$text text={{{ [[colossus]] :let:another[addprefix[something]] [<another>] +[join[-]] }}}/>
+
title: ExpectedResult
<p>colossus</p>

View File

@ -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.
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.
The output of the `:let` filter run prefix is an empty title list.