Effect of spaces between filter steps

61 views
Skip to first unread message

Soren Bjornstad

unread,
Jan 16, 2021, 12:10:45 PM1/16/21
to TiddlyWiki
Hi all,

I know this filter is incorrect, as spaces are only allowed in between filter runs, not between filter steps:

[!is[system] tag[MyTag]]

However, I haven't been able to figure out what exactly TiddlyWiki does when you insert a space in between filter steps. There is no error; instead it tries to do something with the filter you provided. But I can't figure out what that is.

In the example above, the output is the same as just "[!is[system]]", so my hypothesis was that everything after the space is ignored. But I quickly ran across counterexamples, like this one:

[contains:bibliography[xyz] is[tiddler]]

This never returns any results, as far as I can tell, even though either step alone would return many results.

Is there any clear pattern for what happens, or should I just say that the result is undefined if you put a space there?

Mark S.

unread,
Jan 16, 2021, 3:39:55 PM1/16/21
to TiddlyWiki
When I tried this, I got no output for either filter:

<$list filter="[!is[system] tag[MyTag]]" emptyMessage="Nothing #1"/>

<$list filter="[contains:bibliography[xyz] is[tiddler]]" emptyMessage="Nothing #2" />

output:

Nothing #1

Nothing #2

Saq Imtiaz

unread,
Jan 16, 2021, 3:49:02 PM1/16/21
to TiddlyWiki
[!is[system] tag[MyTag]]  

the second step is interpreted as 
operator: " tag"
operand: "MyTag"

All uknown operators are treated as field lookups. 

Soren Bjornstad

unread,
Jan 16, 2021, 3:50:05 PM1/16/21
to TiddlyWiki
Sorry, I guess I was trying to simplify it and forgot to re-test my simplified example. Here's one with a space that does return results:

[!is[system] links[]]

Soren Bjornstad

unread,
Jan 16, 2021, 3:52:14 PM1/16/21
to TiddlyWiki
Saq, this makes good sense, but then why does " links" work?

Saq Imtiaz

unread,
Jan 16, 2021, 4:16:11 PM1/16/21
to TiddlyWiki
On Saturday, January 16, 2021 at 9:52:14 PM UTC+1 Soren Bjornstad wrote:
Saq, this makes good sense, but then why does " links" work?

It doesn't. What I imagine you are seeing is a filter search for every tiddler that either has a field called " links" with an empty value, or does not have the field " links".

This is the behaviour of the field operator that the filter is defaulting to. 

Soren Bjornstad

unread,
Jan 16, 2021, 4:48:30 PM1/16/21
to TiddlyWiki
I didn't phrase that very well. By "works" I meant "returns some output, even garbage output". This makes sense now -- the difference didn't have to do with the operator but rather with the parameter.

Thanks Mark and Saq!

Reply all
Reply to author
Forward
0 new messages