Hi Linus

opens the tiddlers "Test1" and "Test2" as expected. However, when the
> filter is parameterized as follows:
>
> \define openTiddlers(tf)
> <$button>
> <$list filter=$tf$>
> <$action-navigate $to={{!!title}}/>
> </$list>
> Open tiddlers
> </$button>
> \end
>

The $param$ and $(var)$ syntax results in a textual substitution that is
performed on the macro contents before it is parsed.

The problem here is that the textual substitution occurs literally, so if
you pass a value that contains spaces you'll get something like this:

<$list filter=one two three>

So, the solution is to include quotes:

<$list filter="""$tf$""">

By using triple double quotes we ensure that filters that contain single or
double double quotes will work correctly.

Best wishes

Jeremy.




>
> <<openTiddlers "Test1 Test2">>
>
> only "Test1" is opened. Variations such as <<openTiddlers "[[Test1]]
> [[Test2]]">> and <<openTiddlers """Test1 Test2""">> don't work either.
>
> I tried to add parentheses around the parameter:
>
> \define openTiddlers(tf)
> <$button>
> <$list filter=$(tf)$>
> <$action-navigate $to={{!!title}}/>
> </$list>
> Open tiddlers
> </$button>
> \end
>
> which strangely enough opens the tiddler "true". (Why would "$(tf)$"
> evaluate to "true"?) Even worse, when I try to use instead angle brackets:
>
> \define openTiddlers(tf)
> <$button>
> <$list filter=<<tf>> >
> <$action-navigate $to={{!!title}}/>
> </$list>
> Open tiddlers
> </$button>
> \end
>
> seemingly every single tiddler in the Wiki is opened, and eventually it
> crashes completely.
>
> Could anyone give me a hint as to what I'm doing wrong? I would also
> greatly appreciate an explanation of what is going on here, since I
> evidently don't grasp the WikiText semantics yet.
>
>
> Best regards,
> Linus
>
> --
> 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 post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/tiddlywiki.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/tiddlywiki/28276197-2738-4e21-9300-f658364993ce%40googlegroups.com
> <https://groups.google.com/d/msgid/tiddlywiki/28276197-2738-4e21-9300-f658364993ce%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Jeremy Ruston
mailto:[email protected]

-- 
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 post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/CAPKKYJbRBLLyU9x1-kJ7pjX8K_c3G2EjT%2B2dc82JUjt-3AmQsA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to