copy-to-clipboard icon indicating copy to clipboard operation
copy-to-clipboard copied to clipboard

Fix options.format default

Open Pavelas opened this issue 2 years ago • 2 comments

Changelog

  • Fixed options.format default value from text/html to text/plain in README.md file.
var clipboardToIE11Formatting = {
  "text/plain": "Text",
  "text/html": "Url",
  "default": "Text"
}

As you can see, the default is Text not Url

Pavelas avatar Oct 05 '22 14:10 Pavelas

thanks for bringing this up. I don't recall where text/html comes from for this table, need to double check, but from the code it seems that options.format is not set (so it should be null in that table). So the format is going to be whatever execCommand does. In regards to this 'default' that's a value used in IE as fallback if options.format is not found in this clipboardToIE11Formatting so it's not default as in default for copy fn, but more of "default fallback for IE for some fancy formats".

sudodoki avatar Oct 05 '22 20:10 sudodoki

I see, I'll try to double check as well, because yesterday I've spent some time trying to figure out why my clipboard is not being formatted (I haven't used any options), since I saw that the default value is text/html and in the end I've managed to fix it by providing format: 'text/html' option.

Pavelas avatar Oct 06 '22 06:10 Pavelas