mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-08-08 06:43:49 +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:
parent
b8bdb0aeeb
commit
1acef48a10
@ -20,11 +20,9 @@ exports.let = function(operationSubFunction,options) {
|
|||||||
var name = options.suffixes[0][0];
|
var name = options.suffixes[0][0];
|
||||||
// Return the filter run prefix function
|
// Return the filter run prefix function
|
||||||
return function(results,source,widget) {
|
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
|
// Assign the result of the subfunction to the variable
|
||||||
var variables = {};
|
var variables = {};
|
||||||
variables[name] = operationSubFunction(inputSource,widget)[0] || "";
|
variables[name] = operationSubFunction(source,widget)[0] || "";
|
||||||
// Clear the results
|
// Clear the results
|
||||||
results.clear();
|
results.clear();
|
||||||
// Return the variables
|
// Return the variables
|
||||||
|
@ -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>
|
|
@ -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>
|
@ -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 `: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.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user