This page is part of a static HTML representation of the TiddlyWiki at https://tiddlywiki.com/

Then Filter Run Prefix

 10th July 2023 at 7:42am
purposereplace any input to this filter run with its output, only evaluating the run when there is any input
inputall tiddler titles
outputthe output of this filter run replaces the output of previous runs unless it is an empty list (see below)
New in v5.3.0
:thenrun

The :then filter run prefix is used to replace the result of all previous filter runs with its output.

If the result of all previous runs is an empty list, the :then prefixed filter run is not evaluated.

If the output of a :then prefixed filter run is itself an empty list, the result of all previous filter runs is passed through unaltered.

Tip
Note that a list with a single empty string item is not an empty list.

:then run prefix versus the then operator

The major difference between the then operator and a :then prefixed filter run is that the operator will replace each item of the input Title List with its parameter while :then will replace the whole input list with the result of its run.

:then Filter Run Prefixthen Operator
[tag[WikiText]] :then[[true]]
[tag[WikiText]then[true]]

To make them equivalent, additional filter steps may be added:

[tag[WikiText]count[]compare:number:gt[0]then[true]]

Then Filter Run Prefix (Examples)