Hi Mat All you're seeing here is the quoting rules that TiddlyWiki uses for lists; the result of <$set filter> is a list; by design. I suspect that sometimes what you actually want is to access the first element of the list as a single item, without the list quoting. That's something that the <$set filter> widget could be extended to do.
Best wishes Jeremy. On Fri, Apr 1, 2016 at 8:56 AM, Mat <[email protected]> wrote: > Problem illustrated as minimal test case: > > Put this in first tiddler: > > title: tid > text: aaa bbb ccc > > and then this in *another *tiddler; > > Original string (i.e the text in tid): {{tid}}<br> > <$set name="prefix_aaa" filter="[[tid]get[text]splitbefore[aaa]]"> > <$set name="prefix_bbb" filter="[[tid]get[text]splitbefore[bbb]]"> > prefix_aaa: <<prefix_aaa>> (string!) <br> > prefix_bbb: <<prefix_bbb>> ("title"!)<br> > > <$set name="mystring_aaa" filter="[[tid]get[text]splitbefore<prefix_aaa>]" > > > <$set name="mystring_bbb" filter="[[tid]get[text]splitbefore<prefix_bbb>]" > > > mystring_aaa: <<mystring_aaa>> - the original string is splitbefore the > prefix<br> > mystring_bbb: <<mystring_bbb>> - the original string is NOT splitbefore > the prefix` > > </$set> > </$set> > </$set> > </$set> > > > As seen in the prefixes, the filter output "format" differs depending on > if the string contains spaces or not. AFAICT the behaviour is inconsistent > or at least not sensible and has caused problems for me many times in > trying to work with strings. > > My first question if I'm simply approaching it the wrong way and if soeone > has a working (general) solution? > > If not, then I hope to post a git issue about this but I wonder what the > best solution proposal would be; > > I see a need for both title links as output and plain strings as output, > so I'm thinking the best proposal would be for a filter operator ( > string[] ) or perhaps a listwidget parameter that specifies output format > ( format="string" ). Which would be better? Other ideas? > > Thanks! > > <:-) > > -- > 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 https://groups.google.com/group/tiddlywiki. > To view this discussion on the web visit > https://groups.google.com/d/msgid/tiddlywiki/b65dd8ea-ce7c-41c0-ab01-719c6d90018a%40googlegroups.com > <https://groups.google.com/d/msgid/tiddlywiki/b65dd8ea-ce7c-41c0-ab01-719c6d90018a%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 https://groups.google.com/group/tiddlywiki. To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/CAPKKYJbFAbFuns97pLfQCaJroQNL3arOvmYXta3D6-6GbE%3Djxw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.

