Filters and deduplication -- when?

This surprised me:

  <!-- Assume from-label="something" -->

    <$let from-label={{!!rename-from-label}} 
      to-label={{!!rename-to-label}} 
      re="\b"
      from-re-label={{{ [<re>] [<from-label>] [<re>] +[join[]] }}}>

Output: "something\b"

I had to do…

    <$let from-label={{!!rename-from-label}} 
      to-label={{!!rename-to-label}} 
      re="\b"
      from-re-label={{{ [<from-label>addprefix<re>addsuffix<re>] }}}>

to get: "\bsomething\b"

It’s often said that [...] [...] +[join[...]] is the way to concatenate strings, bit it’s clearly not to be relied upon.

My question: exactly when does dedupe occur?

Comments?

I believe you’re looking for “all” instead of “and”.

image

https://tiddlywiki.com/#Shortcut%20Filter%20Run%20Prefix

image

1 Like

Try this:

\define from-label() something

<$let 
      re="\b"
      from-re-label={{{ =[<re>] [<from-label>] =[<re>] +[join[]] }}}
>

<<from-re-label>>

By default every filter run creates a list of unique titles. So deduplication is always active except the :all or = prefix are used.

The enlist and enlist-input filter operators have a raw suffix, which also creates lists that contain duplicates.

2 Likes

:white_check_mark:

Of course, @pmario’s answer is just as valid a solution, and lays out the code nicely. But we can’t mark two solutions…