0
Fork 0
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:
Neil Jenkins 2020-07-27 11:14:36 +10:00
parent 42572d71e4
commit c78bd4aac9
3 changed files with 3 additions and 3 deletions

View file

@ -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

View file

@ -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 );