Hi Mohammad
Just to clarify what’s going on, the filter expression "[$filter$allbefore:include{!!current-item}]” is interpreted as an invocation of the filter operator “$filter$allbefore” (the $filter$ is treated literally since we’re not inside a macro) with the suffix “include” and the operand transcluded from the “current-item” field of the current tiddler. Because there usually isn’t such a field present, the operand will be read as a blank string. Meanwhile, because the filter operator doesn’t exist, the system falls back to using the “field” operator, making the whole expression equivalent to “[field:include[]]” which will look for tiddlers with a blank field “include”. Perhaps unexpectedly, the “field” operator treats tiddlers with a missing field as if the field was blank.
By the way, the technique I used to explore this filter was to run the following in the developer console of
tw5.com:
$tw.wiki.parseFilter("[$filter$allbefore:include{!!current-item}]")
The result is a simple JSON representation of the syntax tree, which can help you to understand how the system is seeing the filter.
Best wishes
Jeremy.