Release note

This commit is contained in:
Jeremy Ruston 2026-01-22 21:01:39 +00:00
parent 3b84a7042c
commit 73cd48cada

View file

@ -0,0 +1,34 @@
title: $:/changenotes/5.4.0/#9595
description: Easier avoidance of deduplication in filters
release: 5.4.0
tags: $:/tags/ChangeNote
change-type: enhancement
change-category: filters
github-links: https://github.com/TiddlyWiki/TiddlyWiki5/pull/9595
github-contributors: Jermolene
Resolves a long-standing issue with filters where there has been no easy way to avoid deduplication of results during filter evaluation. There are two distinct new capabilities.
First, there is a new filter pragma `::defaultprefix` that sets the default filter run prefix for the remainder of the filter expression. Filter pragmas are a new concept akin to wikitext pragmas, allowing special instructions to be embedded in filter expressions.
The `::defaultprefix` pragma takes as its first parameter the desired default filter run prefix, followed by any number of filter operations to which it applies. The default prefix `all` can be used to disable deduplication for the subsequent operations (`or` is the default prefix that performs deduplication).
For example:
```
::defaultprefix:all 1 2 2 1 4 +[join[ ]]
```
Returns `1 2 2 1 4`.
Contrast to the result without the pragma which returns `2 1 4`:
```
1 2 2 1 4 +[join[ ]]
```
Second, there is a new parameter to the `subfilter` and `filter` operators to specify the default filter run prefix to use when the filter is evaluated. This overrides any default set with the `::defaultprefix` pragma.
```
[subfilter:all<my-subfilter>]
```