{"action":"created","issue":{"url":"https://api.github.com/repos/wagtail/wagtail/issues/4582","repository_url":"https://api.github.com/repos/wagtail/wagtail","labels_url":"https://api.github.com/repos/wagtail/wagtail/issues/4582/labels{/name}","comments_url":"https://api.github.com/repos/wagtail/wagtail/issues/4582/comments","events_url":"https://api.github.com/repos/wagtail/wagtail/issues/4582/events","html_url":"https://github.com/wagtail/wagtail/pull/4582","id":329216679,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkyNTI4MjMx","number":4582,"title":"Fix copy-paste between editors losing formatting/content #4432","user":{"login":"thibaudcolas","id":877585,"node_id":"MDQ6VXNlcjg3NzU4NQ==","avatar_url":"https://avatars1.githubusercontent.com/u/877585?v=4","gravatar_id":"","url":"https://api.github.com/users/thibaudcolas","html_url":"https://github.com/thibaudcolas","followers_url":"https://api.github.com/users/thibaudcolas/followers","following_url":"https://api.github.com/users/thibaudcolas/following{/other_user}","gists_url":"https://api.github.com/users/thibaudcolas/gists{/gist_id}","starred_url":"https://api.github.com/users/thibaudcolas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thibaudcolas/subscriptions","organizations_url":"https://api.github.com/users/thibaudcolas/orgs","repos_url":"https://api.github.com/users/thibaudcolas/repos","events_url":"https://api.github.com/users/thibaudcolas/events{/privacy}","received_events_url":"https://api.github.com/users/thibaudcolas/received_events","type":"User","site_admin":false},"labels":[{"id":416277756,"node_id":"MDU6TGFiZWw0MTYyNzc3NTY=","url":"https://api.github.com/repos/wagtail/wagtail/labels/component:Rich%20text","name":"component:Rich text","color":"d4c5f9","default":false},{"id":181311678,"node_id":"MDU6TGFiZWwxODEzMTE2Nzg=","url":"https://api.github.com/repos/wagtail/wagtail/labels/status:Needs%20review","name":"status:Needs review","color":"fbca04","default":false},{"id":78418438,"node_id":"MDU6TGFiZWw3ODQxODQzOA==","url":"https://api.github.com/repos/wagtail/wagtail/labels/type:Bug","name":"type:Bug","color":"ff0000","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/wagtail/wagtail/milestones/53","html_url":"https://github.com/wagtail/wagtail/milestone/53","labels_url":"https://api.github.com/repos/wagtail/wagtail/milestones/53/labels","id":3320455,"node_id":"MDk6TWlsZXN0b25lMzMyMDQ1NQ==","number":53,"title":"2.2","description":"","creator":{"login":"gasman","id":85097,"node_id":"MDQ6VXNlcjg1MDk3","avatar_url":"https://avatars2.githubusercontent.com/u/85097?v=4","gravatar_id":"","url":"https://api.github.com/users/gasman","html_url":"https://github.com/gasman","followers_url":"https://api.github.com/users/gasman/followers","following_url":"https://api.github.com/users/gasman/following{/other_user}","gists_url":"https://api.github.com/users/gasman/gists{/gist_id}","starred_url":"https://api.github.com/users/gasman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gasman/subscriptions","organizations_url":"https://api.github.com/users/gasman/orgs","repos_url":"https://api.github.com/users/gasman/repos","events_url":"https://api.github.com/users/gasman/events{/privacy}","received_events_url":"https://api.github.com/users/gasman/received_events","type":"User","site_admin":false},"open_issues":22,"closed_issues":11,"state":"open","created_at":"2018-05-04T15:14:23Z","updated_at":"2018-06-14T15:34:13Z","due_on":"2018-07-23T07:00:00Z","closed_at":null},"comments":0,"created_at":"2018-06-04T21:05:22Z","updated_at":"2018-06-14T17:27:49Z","closed_at":"2018-06-14T10:29:59Z","author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/wagtail/wagtail/pulls/4582","html_url":"https://github.com/wagtail/wagtail/pull/4582","diff_url":"https://github.com/wagtail/wagtail/pull/4582.diff","patch_url":"https://github.com/wagtail/wagtail/pull/4582.patch"},"body":"Fixes #4432. This pull request has been made possible by the backing of my [Patreon patrons](https://www.patreon.com/thibaud_colas).\r\n\r\nThe current copy-paste behavior is a mixture of the browser's default copy behavior, and the Draft.js paste processing.\r\n\r\nWith this Draftail update, we now override the defaults for both copy and paste between editors:\r\n\r\n- Copy should fill the clipboard with the same markup as before, except with a serialised version of the Draft.js content included, and with less inline styles (can lead to some discrepancies in how word processors receive the pasted content)\r\n- Paste should work the same in all scenarios, except when the content comes from a Draftail editor. There, it will insert the Draft.js content directly instead of its HTML representation.\r\n\r\n![draftail-copy-paste-4432](https://user-images.githubusercontent.com/877585/40942274-5eca06e6-6856-11e8-9268-2bfacaafe58d.gif)\r\n\r\n\r\nTested in: \r\n\r\n- [x] Windows 10, IE11 (no support, default \"plain text\" behavior)\r\n- [x] Windows 10, Edge 17\r\n- [x] macOS 10.13, Firefox latest\r\n- [x] macOS 10.13, Chrome latest\r\n- [x] macOS 10.13, Safari latest\r\n- [x] iOS 11.3 Safari\r\n- [x] Android Chrome 7.1\r\n\r\n---\r\n\r\nThis fixes quite a few of the known issues with Draft.js (#4274), see the potential diff over at https://github.com/springload/draftail/issues/147#issuecomment-394202357. I'll update the list myself once this PR is merged.\r\n\r\nThe underlying code changes are:\r\n\r\n- https://github.com/thibaudcolas/draftjs-conductor/pull/2 (new copy-paste processing)\r\n- https://github.com/thibaudcolas/draftjs-conductor/pull/3 (bug fix)\r\n- https://github.com/springload/draftail/pull/155 (integration into the editor)"},"comment":{"url":"https://api.github.com/repos/wagtail/wagtail/issues/comments/397375006","html_url":"https://github.com/wagtail/wagtail/pull/4582#issuecomment-397375006","issue_url":"https://api.github.com/repos/wagtail/wagtail/issues/4582","id":397375006,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NzM3NTAwNg==","user":{"login":"thibaudcolas","id":877585,"node_id":"MDQ6VXNlcjg3NzU4NQ==","avatar_url":"https://avatars1.githubusercontent.com/u/877585?v=4","gravatar_id":"","url":"https://api.github.com/users/thibaudcolas","html_url":"https://github.com/thibaudcolas","followers_url":"https://api.github.com/users/thibaudcolas/followers","following_url":"https://api.github.com/users/thibaudcolas/following{/other_user}","gists_url":"https://api.github.com/users/thibaudcolas/gists{/gist_id}","starred_url":"https://api.github.com/users/thibaudcolas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thibaudcolas/subscriptions","organizations_url":"https://api.github.com/users/thibaudcolas/orgs","repos_url":"https://api.github.com/users/thibaudcolas/repos","events_url":"https://api.github.com/users/thibaudcolas/events{/privacy}","received_events_url":"https://api.github.com/users/thibaudcolas/received_events","type":"User","site_admin":false},"created_at":"2018-06-14T17:27:49Z","updated_at":"2018-06-14T17:27:49Z","author_association":"MEMBER","body":"🎉"}}
{"actor":{"display_login":"thibaudcolas"}}