mirror of
https://github.com/fastmail/Squire.git
synced 2024-12-22 07:13:08 -05:00
If text == html, only copy as plain text
It must be plain text if they're the same, and this helps avoid a Safari bug (when we can) where when you copy HTML and then paste it in Pages/Numbers, it gets the charset wrong and mangles non-ASCII characters.
This commit is contained in:
parent
42572d71e4
commit
c78bd4aac9
3 changed files with 3 additions and 3 deletions
|
@ -2260,7 +2260,7 @@ var setClipboardData =
|
|||
text = text.replace( /\r?\n/g, '\r\n' );
|
||||
}
|
||||
|
||||
if ( !plainTextOnly ) {
|
||||
if ( !plainTextOnly && text !== html ) {
|
||||
clipboardData.setData( 'text/html', html );
|
||||
}
|
||||
clipboardData.setData( 'text/plain', text );
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -39,7 +39,7 @@ var setClipboardData =
|
|||
text = text.replace( /\r?\n/g, '\r\n' );
|
||||
}
|
||||
|
||||
if ( !plainTextOnly ) {
|
||||
if ( !plainTextOnly && text !== html ) {
|
||||
clipboardData.setData( 'text/html', html );
|
||||
}
|
||||
clipboardData.setData( 'text/plain', text );
|
||||
|
|
Loading…
Reference in a new issue