Hi Stephan, In order to "flatten" the titles retrieved from the filter, you need to use the *select* attribute of your <$set> widget like so: <$set name="left" filter="[<testtext>splitbefore[ -- ]removesuffix[ -- ]]" select=0>
Cheers, -- Xavier Cazin On Tue, Jul 2, 2019 at 8:44 AM Stephan Hradek <stephan.hra...@gmail.com> wrote: > For my mailto-link I want to supply a tiddlername and a linktext to a > macro. > > For this I thought it would be a good ideat to do it in the form of > > {{the tiddler with the mail template -- the linktext||mailto}} > > So the idea is to have a mailtext in the tiddler (the tiddler with the > mail template) and to create a mailto-link of the form > > <a href="mailto:…">the linktext</a> > > So for this I need to split the text at " -- ", but this only worked, > when my tiddler's title does not contain a blank. Otherwise it fails. > > Here is a simple tiddler for you to test: > > <$set name="testtext" value="the tiddler with the mail template -- the > linktext"> > > <$set name="left" filter="[<testtext>splitbefore[ -- ]removesuffix[ -- ]]"> > > <$set name="right" filter="[<testtext>removeprefix<left>removeprefix[ -- > ]]"> > > Original: <$text text=<<testtext>>/> > > Left of ' -- ': <$text text=<<left>>/> > > Right of ' -- ': <$text text=<<right>>/> > > </$set> > </$set> > </$set> > > The output is > > Original: the tiddler with the mail template -- the linktext > > > Left of ' – ': [[the tiddler with the mail template]] > > > Right of ' – ': > > Without spaces the output is > > Original: the_tiddler_with_the_mail_template -- the linktext > > Left of ' – ': the_tiddler_with_the_mail_template > > > Right of ' – ': [[the linktext]] > > So for some reason there are square brackets added to the variable's value > which will make my nice logic fail. > > Is there a way around this? > > > > > > > > > > > -- > 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 tiddlywiki+unsubscr...@googlegroups.com. > To post to this group, send email to tiddlywiki@googlegroups.com. > 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/1fe8473f-9fb3-482c-b4a9-975eedc4b093%40googlegroups.com > <https://groups.google.com/d/msgid/tiddlywiki/1fe8473f-9fb3-482c-b4a9-975eedc4b093%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- 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 tiddlywiki+unsubscr...@googlegroups.com. To post to this group, send email to tiddlywiki@googlegroups.com. 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/CADeSwYP_%3Dg19GSRf%3DG-BFBpKHs0c54OwhK%3DHq6tq4P0FPR3hdg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.