I'm fairly certain I've done this before, but I can't find any documentation about it. I'm finding this issue is oddly hard to research.
I'd like to display one version (A) of a bit of text on screen. However, when the text is copied, a different version of that text (B) is actually copied to the clipboard. In practice, A and B might be very similar, but the technique should allow for A and B to be completely different strings.
For example, if I use a <div>
to display the following to the user:
<div>This is a really long...</div>
...and the user selects the div and issues a "copy" on it, I would like the text that is placed on the clipboard to be:
This is a really long bit of text that is too large to display on-screen, but should be fully intact when copy/pasted.
(Of course, my app would separately take care of shortening the first instance of the string and adding the ellipses.)
I seem to recall this being possible with simple HTML/CSS, but the details are eluding me... Thoughts?