I'd like to put some code listings on a web page. Sometimes they're lists of commands to be copied. I'd like to show prompts in those code listings, yet make them somehow non-copyable, so that when user copies the text, he won't copy the prompts by mistake.
Note that I don't want to “protect” the content, I just want to help user not make mistake.
I tried to apply CSS rules to disable text selecting, but it seems that even then if you highlight and copy multiple commands at once, prompts are copied together with the text—at least this is what I see in Google Chrome. Try for yourself, what gets into my clipboard is:
def hello(text):
....: print "Hello {}!".format(text)
....: print "Bye, cruel {}!".format(text)
....:
In [24]: def foo(bar):
....: print 'Another helper function.'
....: bar.boom()
....:
So, how to do it right?