I am satisfied with the  `<$vars tagList={{{ 
[enlist{$:/temp/tagSearch}sort[]join[,]] }}}>` solution. I may have other 
questions to make my custom search tiddler look nicer, but that can be a 
separate thread if needed. Tyvm again for the help!

On Thursday, September 23, 2021 at 9:06:51 PM UTC-4 Eric Shulman wrote:

> On Thursday, September 23, 2021 at 3:57:35 PM UTC-7 [email protected] 
> wrote:
>
>> How might I make this searching tiddler more robust in the presence of 
>> "tags with spaces", since I also use spaces to delimit tags in the 
>> `edit-text`?
>>
>
> The problem is the use of
> `<$set name="tagList" filter="[enlist{$:/temp/tagSearch}sort[]join[,]]">`
>
> Let’s say you entered “foo [[bar baz]]” (i.e., two tags, “foo” and “bar 
> baz”).
>
> Then, you might expect the results of the above $set widget to be “foo,bar 
> baz”. However, because this string contains a space, the $set widget 
> *automatically 
> encloses the output in double square brackets*. Thus, the actual result 
> is “[[foo,bar baz]]”. Then, when you use `match<tagList>` later on, it 
> expects those square brackets to be part of the literal string match.
>
> The solution is to use $vars with a “filtered transclusion” for the value, 
> instead of $set, like this:
> `<$vars tagList={{{ [enlist{$:/temp/tagSearch}sort[]join[,]] }}}>`
> Then, tagList will be “foo,bar baz”, as you intended.
>
> Alternatively, you *can* use $set, by adding “select=0” as an extra 
> parameter, like this:
> `<$set name="tagList" filter="[enlist{$:/temp/tagSearch}sort[]join[,]]" 
> select=0>`
> This tells the $set widget to only return the first list item (i.e., 
> item #0), without adding any square brackets.
> -e
>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/3d9522b5-d61a-459e-ab3f-85c7452fd766n%40googlegroups.com.

Reply via email to