{"action":"created","issue":{"url":"https://api.github.com/repos/yabwe/medium-editor/issues/710","labels_url":"https://api.github.com/repos/yabwe/medium-editor/issues/710/labels{/name}","comments_url":"https://api.github.com/repos/yabwe/medium-editor/issues/710/comments","events_url":"https://api.github.com/repos/yabwe/medium-editor/issues/710/events","html_url":"https://github.com/yabwe/medium-editor/pull/710","id":91789819,"number":710,"title":"Fix for #666: Creating and removing nested lists by indenting/outdenting","user":{"login":"mphasize","id":331830,"avatar_url":"https://avatars.githubusercontent.com/u/331830?v=3","gravatar_id":"","url":"https://api.github.com/users/mphasize","html_url":"https://github.com/mphasize","followers_url":"https://api.github.com/users/mphasize/followers","following_url":"https://api.github.com/users/mphasize/following{/other_user}","gists_url":"https://api.github.com/users/mphasize/gists{/gist_id}","starred_url":"https://api.github.com/users/mphasize/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mphasize/subscriptions","organizations_url":"https://api.github.com/users/mphasize/orgs","repos_url":"https://api.github.com/users/mphasize/repos","events_url":"https://api.github.com/users/mphasize/events{/privacy}","received_events_url":"https://api.github.com/users/mphasize/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-06-29T12:27:44Z","updated_at":"2015-06-29T13:09:04Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/yabwe/medium-editor/pulls/710","html_url":"https://github.com/yabwe/medium-editor/pull/710","diff_url":"https://github.com/yabwe/medium-editor/pull/710.diff","patch_url":"https://github.com/yabwe/medium-editor/pull/710.patch"},"body":"This PR aims to correctly handle indenting and outdenting lists (i.e. nesting lists). (see #666 for discussion)\r\n\r\n`medium-editor` triggers the action through a contenteditable browser `execCommand`, so we would expect the browser to produce valid DOM as a result of that command, but unfortunately popular browsers like Chrome in fact create invalid DOM. So instead of relying on the browser, we need to execute the command and follow up with inspecting the created DOM and fixing it when the structure is not correct. Since there already is a `cleanListDOM` function in the code, we can build on that and include these use cases.\r\n\r\nW3 spec for nested lists for reference: http://www.w3.org/wiki/HTML_lists#Nesting_lists\r\n\r\nThis PR:\r\n- [x] fixes the content test case, using valid DOM structures in the test case\r\n- [x] runs `cleanListDOM` after indenting or outdenting a list\r\n- [x] extends `cleanListDOM` to properly un-/wrap `ol`, `ul` and `li` after indenting/outdenting a list\r\n- [x] fix position of the cursor after indenting / outdenting"},"comment":{"url":"https://api.github.com/repos/yabwe/medium-editor/issues/comments/116653687","html_url":"https://github.com/yabwe/medium-editor/pull/710#issuecomment-116653687","issue_url":"https://api.github.com/repos/yabwe/medium-editor/issues/710","id":116653687,"user":{"login":"j0k3r","id":62333,"avatar_url":"https://avatars.githubusercontent.com/u/62333?v=3","gravatar_id":"","url":"https://api.github.com/users/j0k3r","html_url":"https://github.com/j0k3r","followers_url":"https://api.github.com/users/j0k3r/followers","following_url":"https://api.github.com/users/j0k3r/following{/other_user}","gists_url":"https://api.github.com/users/j0k3r/gists{/gist_id}","starred_url":"https://api.github.com/users/j0k3r/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/j0k3r/subscriptions","organizations_url":"https://api.github.com/users/j0k3r/orgs","repos_url":"https://api.github.com/users/j0k3r/repos","events_url":"https://api.github.com/users/j0k3r/events{/privacy}","received_events_url":"https://api.github.com/users/j0k3r/received_events","type":"User","site_admin":false},"created_at":"2015-06-29T13:09:04Z","updated_at":"2015-06-29T13:09:04Z","body":"@IonicaBizau you mean by using postinstall script? In fact, we don't want to pollute npm with all our files.\r\n\r\nWe recently remove sass files from bower and I tihnk it's better to send only dist files and undist but concat files instead of everything.\r\n\r\nBut maybe we shouldn't pollute the @mphasize PR and discuss that on a separate issue."}}