I'm trying to use replace on a formatted text and to place the result in the clipboard. But .replace()
works only with string. I have to replace hyperlinked links in clipboard. I'm trying to learn javascript but it's hard.
var text = window.getSelection();
var modified=text.replace("https://google", "google");
e.clipboardData.setData('text/plain', modified);
I checked .setData
ad it allows only text not formatted string.