{"action":"closed","issue":{"url":"https://api.github.com/repos/ianstormtaylor/slate/issues/2064","repository_url":"https://api.github.com/repos/ianstormtaylor/slate","labels_url":"https://api.github.com/repos/ianstormtaylor/slate/issues/2064/labels{/name}","comments_url":"https://api.github.com/repos/ianstormtaylor/slate/issues/2064/comments","events_url":"https://api.github.com/repos/ianstormtaylor/slate/issues/2064/events","html_url":"https://github.com/ianstormtaylor/slate/issues/2064","id":349209220,"node_id":"MDU6SXNzdWUzNDkyMDkyMjA=","number":2064,"title":"Slate data fragment merging leads to extra line breaks","user":{"login":"Slapbox","id":6835891,"node_id":"MDQ6VXNlcjY4MzU4OTE=","avatar_url":"https://avatars2.githubusercontent.com/u/6835891?v=4","gravatar_id":"","url":"https://api.github.com/users/Slapbox","html_url":"https://github.com/Slapbox","followers_url":"https://api.github.com/users/Slapbox/followers","following_url":"https://api.github.com/users/Slapbox/following{/other_user}","gists_url":"https://api.github.com/users/Slapbox/gists{/gist_id}","starred_url":"https://api.github.com/users/Slapbox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Slapbox/subscriptions","organizations_url":"https://api.github.com/users/Slapbox/orgs","repos_url":"https://api.github.com/users/Slapbox/repos","events_url":"https://api.github.com/users/Slapbox/events{/privacy}","received_events_url":"https://api.github.com/users/Slapbox/received_events","type":"User","site_admin":false},"labels":[{"id":404055005,"node_id":"MDU6TGFiZWw0MDQwNTUwMDU=","url":"https://api.github.com/repos/ianstormtaylor/slate/labels/bug","name":"bug","color":"f9d0c4","default":true},{"id":404056337,"node_id":"MDU6TGFiZWw0MDQwNTYzMzc=","url":"https://api.github.com/repos/ianstormtaylor/slate/labels/%E2%99%A5%20help%20please","name":"♥ help please","color":"f2cee2","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-08-09T16:52:56Z","updated_at":"2018-10-25T17:08:19Z","closed_at":"2018-10-25T17:08:19Z","author_association":"CONTRIBUTOR","body":"In particular, with lists, but no doubt this affects other types too. This makes envisioning a full solution difficult as I can't imagine all the different scenarios which a solution needs to cover.\r\n\r\nThere's not, as far as I can tell, 100% standard behavior across all editors on this, but we can definitely improve Slate's behavior to be more predictable for users anyway.\r\n\r\n**Here's how Google Docs handles an example for lists:**\r\nhttp://recordit.co/SEzxiNiodn\r\n\r\n**Here's how Slate handles it:**\r\nhttp://recordit.co/Gr9dTOaKHi\r\n\r\nThe fragments Slate decodes look like this:\r\n\r\n![image](https://user-images.githubusercontent.com/6835891/43913177-5515c2ac-9bd2-11e8-8679-a03cc23cb585.png)\r\n\r\n### Relevant files\r\n**The line where a fragment is encoded into the HTML on copy:** https://github.com/ianstormtaylor/slate/blob/master/packages/slate-react/src/utils/clone-fragment.js#L33\r\n\r\n**First line where an encoded fragment is decoded (if it exists) on paste:** https://github.com/ianstormtaylor/slate/blob/master/packages/slate-react/src/utils/get-event-transfer.js#L64 << This is probably the file we need to modify\r\n\r\nIt occurs to me we can check the types of the enclosing block for the fragment and for the paste location and avoid duplicating the block type, in this case `numbered-list`, if they match, but I'm not sure if this covers all use cases.\r\n\r\nCan anyone think of a possible case this wouldn't work in? For me, tables come to mind, but if you try to paste table rows inside a table, you're gonna have a bad time. This seems beyond what Slate itself needs to handle, and an acceptable solution in my view should simply not interfere with someone else who wants to extend the behavior to handle tables."}}
{"actor":{"display_login":"ianstormtaylor"}}