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!
<:-)