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 [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/1fe8473f-9fb3-482c-b4a9-975eedc4b093%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.