I’m getting tripped up on something that’s probably simple… what I’m trying to do is dynamically build an external link based on a modification of a url I’ll copy paste in.
I’m considering moving from Outlook desktop client to Outlook web client. The implication is that I store a bunch of links to individual emails in my wiki. On the desktop side that’s via the outlook:: protocol
. In the web client, when you’re looking at a message it looks like this: https://outlook.office.com/mail/archive/id/AAMk...
I then need to change the front end to start with https://outlook.office.com/mail/deeplink?ItemID=
and then add on some characters at the end &exvsurl=1
, then send that as the “href” to a link.
To make it quick (as I will need to do this multiple times per day), my goal is to write a macro so that all I have to do is type <<mail "paste-here">>
and have the external link nicely ready to go, but every time I try a different way to do it, tiddlywiki is trying to be helpful and changing things.
This is an example of one of the few ways that didn’t work:
\define mail(url)
{{{ [[$url$]removeprefix[https://outlook.office.com/mail/archive/id/]addprefix[<a href="https://outlook.office.com/mail/deeplink?ItemID=]addsuffix[&exvsurl=1">email</a>]] }}}
\end
<<mail "https://outlook.office.com/mail/archive/id/AAMk....">>
that returns the text I want:
but the hover to the link looks like:
and doesn’t work (note that I’m using Node.js for TiddlyWiki)