Is there a cross platform way to copy a link and caption to the clipboard, ie so google.com appears as 'Google' when pasted, but is a clickable link.

When copying Spotify URLs this works.

Preferrably this can be executed in JS.