[TW5] When setting filters as perimeter for a macro, it doesn't work if the filter is a tag with spaces.

38 views
Skip to first unread message

Penguinlay

unread,
Jan 3, 2017, 5:09:20 AM1/3/17
to TiddlyWiki
I have a simple macro to count number of tiddlers under a input filter. Title is countTiddlers.

It is tagged with 
$:/tags/Macro

The content is:
\define countTiddlers(filter)
<$count filter="[$filter$]"/>
\end



Now, from a different tiddler, I access that macro.

<<countTiddlers tag[Tag Tiddler Title With Space]>>

If the tag tiddler title has space, it doesn't work. Also, it didn't work for title[Tiddler Title With Space] and other filters with spaces.


As a test, is[system], tag[TagTiddlerTitleWithoutSpace] and any other filters without spaces work fine.

So, is there anything I did wrong here? Or, is there anyway to get around it?

Jed Carty

unread,
Jan 3, 2017, 5:21:46 AM1/3/17
to TiddlyWiki
You need to put quotes around the filter like this:

<<countTiddlers "tag[Something With Spaces]">>


otherwise it is split up as a space separated list of inputs and only tag[Something is passed as the first parameter.

Penguinlay

unread,
Jan 3, 2017, 5:25:34 AM1/3/17
to TiddlyWiki
I see now! Thank you very much!
Reply all
Reply to author
Forward
Message has been deleted
0 new messages