I use a simple third party library to copy something to clipboard.
The something is always some programming code. In these examples it is HTML and Python codes.
Copy (fail)
Copy (success)
In short: whatever is placed in data-clipboard-text attribute of a button, will be copied to the clipboard.
Please, press a Copy button in the example and insert into a text editor what there is in the clipboard.
Copy (fail) button copies the contents of its data-clipboard-text but it consists only of whitespace characters and line breaks.
Morever, when I run this at my localhost, I get this error after clicking the fail button:
Refused to apply style from 'http://localhost:8000/draft/linux/install-os-ubuntu/stylesheets/style.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
The reason seems that HTML is considered to be a real HTML. The browser looks for sources, fails and sends the error. But for my purpose this is just a string.
Could you help me understand why this situation occurs and cope with the problem of copying HTML documents.