This is a simple solution
\define rmv(url) {{{ [[$url$]removeprefix[https://]]
~[[$url$]removeprefix[http://]] }}}
Examples:
<<rmv """https://google.com""">>
<<rmv """http://google.com""">>
On Tuesday, November 24, 2020 at 7:20:22 AM UTC+3:30 W Yan wrote:
> Hi, I'm trying to remove https:// and http:// from url fields. I've tried
> <$text text={{{ [{!!url}removeprefix[https://]] }}} /> and it works, but I
> don't know how to make it work depending on whether url has https or http.
> Seems like just adding another removeprefix[http://] completely removes the
> url.
>
> Also need help with using <img src="<$transclude field=image/>" >
> properly; I know why it doesn't work but I have no idea how to make it
> work. I would appreciate any help.
>
> W Yan
>
--
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 view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywiki/b6f7f4cd-b7bb-42f5-a8c9-48906f87ec22n%40googlegroups.com.