copy-to-clipboard
copy-to-clipboard copied to clipboard
Fix options.format default
Changelog
- Fixed
options.format
default value fromtext/html
totext/plain
inREADME.md
file.
var clipboardToIE11Formatting = {
"text/plain": "Text",
"text/html": "Url",
"default": "Text"
}
As you can see, the default is Text
not Url
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".
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.