{"action":"created","comment":{"url":"https://api.github.com/repos/bustlelabs/content-kit-editor/pulls/comments/35231376","id":35231376,"diff_hunk":"@@ -5,6 +5,10 @@ let visitor = {\n     opcodes.push(['openPost']);\n     visitArray(visitor, node.sections, opcodes);\n   },\n+  section(node, opcodes) {","path":"src/js/renderers/mobiledoc.js","position":4,"original_position":4,"commit_id":"63b8fbfe809f78637ef4320bede9b80baf5f2ca4","original_commit_id":"63b8fbfe809f78637ef4320bede9b80baf5f2ca4","user":{"login":"mixonic","id":8752,"avatar_url":"https://avatars.githubusercontent.com/u/8752?v=3","gravatar_id":"","url":"https://api.github.com/users/mixonic","html_url":"https://github.com/mixonic","followers_url":"https://api.github.com/users/mixonic/followers","following_url":"https://api.github.com/users/mixonic/following{/other_user}","gists_url":"https://api.github.com/users/mixonic/gists{/gist_id}","starred_url":"https://api.github.com/users/mixonic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mixonic/subscriptions","organizations_url":"https://api.github.com/users/mixonic/orgs","repos_url":"https://api.github.com/users/mixonic/repos","events_url":"https://api.github.com/users/mixonic/events{/privacy}","received_events_url":"https://api.github.com/users/mixonic/received_events","type":"User","site_admin":false},"body":"Should be a `markupSection` type","created_at":"2015-07-22T16:15:36Z","updated_at":"2015-07-22T16:15:36Z","html_url":"https://github.com/bustlelabs/content-kit-editor/pull/23#discussion_r35231376","pull_request_url":"https://api.github.com/repos/bustlelabs/content-kit-editor/pulls/23","_links":{"self":{"href":"https://api.github.com/repos/bustlelabs/content-kit-editor/pulls/comments/35231376"},"html":{"href":"https://github.com/bustlelabs/content-kit-editor/pull/23#discussion_r35231376"},"pull_request":{"href":"https://api.github.com/repos/bustlelabs/content-kit-editor/pulls/23"}}},"pull_request":{"url":"https://api.github.com/repos/bustlelabs/content-kit-editor/pulls/23","id":40311213,"html_url":"https://github.com/bustlelabs/content-kit-editor/pull/23","diff_url":"https://github.com/bustlelabs/content-kit-editor/pull/23.diff","patch_url":"https://github.com/bustlelabs/content-kit-editor/pull/23.patch","issue_url":"https://api.github.com/repos/bustlelabs/content-kit-editor/issues/23","number":23,"state":"open","locked":false,"title":"Post, Section, Markers","user":{"login":"bantic","id":2023,"avatar_url":"https://avatars.githubusercontent.com/u/2023?v=3","gravatar_id":"","url":"https://api.github.com/users/bantic","html_url":"https://github.com/bantic","followers_url":"https://api.github.com/users/bantic/followers","following_url":"https://api.github.com/users/bantic/following{/other_user}","gists_url":"https://api.github.com/users/bantic/gists{/gist_id}","starred_url":"https://api.github.com/users/bantic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bantic/subscriptions","organizations_url":"https://api.github.com/users/bantic/orgs","repos_url":"https://api.github.com/users/bantic/repos","events_url":"https://api.github.com/users/bantic/events{/privacy}","received_events_url":"https://api.github.com/users/bantic/received_events","type":"User","site_admin":false},"body":"WIP to use `Post`, `Section`, `Marker`, `Markup` models to build the internal `post` model that the editor has.\r\n\r\nI started this as a WIP to see what it would take to be able to semantically handle section-breaking actions (like hitting `<enter>` or clicking the \"h2\" on the toolbar) and section-joining actions (highlighting text across sections and deleting, putting the cursor at the beginning of a section and deleting). I started with the `Marker` concept representing text with possible markups applied to it and thinking of the methods a `Marker` would need in order to handle the cases mentioned above. I rewrote the post/section parser to use the marker/markup construct internally as well. This fixes the problem of ignorable (ie `<span>`) elements causing the parser to generate separate markers for the same string of text.\r\n\r\nA `Post` hasMany `sections`, a `Section` hasMany `markers`, a `Marker` has a tagName and many `markups`.\r\n\r\nAdds a `PostParser` (from DOM to Post) and its `SectionParser`. The `PostParser` is simpler than the existing dom parser, partly because it makes the simplifying assumption that if it is parsing dom into a post, only the top-level element's children are potentially valid sections. It will ignore invalid (from its perspective) dom like a nested section tag inside another (`<p>first section<p>inner section</p> continue first section</p>`).\r\n\r\nIn order to be usable, these need to happen:\r\n  * [ ] Enhance SectionParser to parse Image sections\r\n  * [ ] Change Mobiledoc renderer to consume this format (the major change is that markers don't have `open` and `close` properties on them anymore)\r\n  * [ ] The post-builder is probably not necessary, because all the primitives exist and have their own constructors (`new Section()`, `new Marker()`, `new Markup()`).\r\n\r\nThe goal of this was to eventually be able to add event listeners for section-breaking (`<enter>` key) and section-joining (`delete` key) actions that the user might take and apply those directly to the internal `post` model rather than the current heuristic of attempting to detect which sections might have been affected or removed.","created_at":"2015-07-19T16:48:43Z","updated_at":"2015-07-22T16:15:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"11dc26a571564c66d8633141a5a27aab02763bf4","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/bustlelabs/content-kit-editor/pulls/23/commits","review_comments_url":"https://api.github.com/repos/bustlelabs/content-kit-editor/pulls/23/comments","review_comment_url":"https://api.github.com/repos/bustlelabs/content-kit-editor/pulls/comments{/number}","comments_url":"https://api.github.com/repos/bustlelabs/content-kit-editor/issues/23/comments","statuses_url":"https://api.github.com/repos/bustlelabs/content-kit-editor/statuses/63b8fbfe809f78637ef4320bede9b80baf5f2ca4","head":{"label":"bustlelabs:markers","ref":"markers","sha":"63b8fbfe809f78637ef4320bede9b80baf5f2ca4","user":{"login":"bustlelabs","id":2198187,"avatar_url":"https://avatars.githubusercontent.com/u/2198187?v=3","gravatar_id":"","url":"https://api.github.com/users/bustlelabs","html_url":"https://github.com/bustlelabs","followers_url":"https://api.github.com/users/bustlelabs/followers","following_url":"https://api.github.com/users/bustlelabs/following{/other_user}","gists_url":"https://api.github.com/users/bustlelabs/gists{/gist_id}","starred_url":"https://api.github.com/users/bustlelabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bustlelabs/subscriptions","organizations_url":"https://api.github.com/users/bustlelabs/orgs","repos_url":"https://api.github.com/users/bustlelabs/repos","events_url":"https://api.github.com/users/bustlelabs/events{/privacy}","received_events_url":"https://api.github.com/users/bustlelabs/received_events","type":"Organization","site_admin":false},"repo":{"id":21694966,"name":"content-kit-editor","full_name":"bustlelabs/content-kit-editor","owner":{"login":"bustlelabs","id":2198187,"avatar_url":"https://avatars.githubusercontent.com/u/2198187?v=3","gravatar_id":"","url":"https://api.github.com/users/bustlelabs","html_url":"https://github.com/bustlelabs","followers_url":"https://api.github.com/users/bustlelabs/followers","following_url":"https://api.github.com/users/bustlelabs/following{/other_user}","gists_url":"https://api.github.com/users/bustlelabs/gists{/gist_id}","starred_url":"https://api.github.com/users/bustlelabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bustlelabs/subscriptions","organizations_url":"https://api.github.com/users/bustlelabs/orgs","repos_url":"https://api.github.com/users/bustlelabs/repos","events_url":"https://api.github.com/users/bustlelabs/events{/privacy}","received_events_url":"https://api.github.com/users/bustlelabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/bustlelabs/content-kit-editor","description":"A modern, minimalist WYSIWYG editor","fork":false,"url":"https://api.github.com/repos/bustlelabs/content-kit-editor","forks_url":"https://api.github.com/repos/bustlelabs/content-kit-editor/forks","keys_url":"https://api.github.com/repos/bustlelabs/content-kit-editor/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bustlelabs/content-kit-editor/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bustlelabs/content-kit-editor/teams","hooks_url":"https://api.github.com/repos/bustlelabs/content-kit-editor/hooks","issue_events_url":"https://api.github.com/repos/bustlelabs/content-kit-editor/issues/events{/number}","events_url":"https://api.github.com/repos/bustlelabs/content-kit-editor/events","assignees_url":"https://api.github.com/repos/bustlelabs/content-kit-editor/assignees{/user}","branches_url":"https://api.github.com/repos/bustlelabs/content-kit-editor/branches{/branch}","tags_url":"https://api.github.com/repos/bustlelabs/content-kit-editor/tags","blobs_url":"https://api.github.com/repos/bustlelabs/content-kit-editor/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bustlelabs/content-kit-editor/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bustlelabs/content-kit-editor/git/refs{/sha}","trees_url":"https://api.github.com/repos/bustlelabs/content-kit-editor/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bustlelabs/content-kit-editor/statuses/{sha}","languages_url":"https://api.github.com/repos/bustlelabs/content-kit-editor/languages","stargazers_url":"https://api.github.com/repos/bustlelabs/content-kit-editor/stargazers","contributors_url":"https://api.github.com/repos/bustlelabs/content-kit-editor/contributors","subscribers_url":"https://api.github.com/repos/bustlelabs/content-kit-editor/subscribers","subscription_url":"https://api.github.com/repos/bustlelabs/content-kit-editor/subscription","commits_url":"https://api.github.com/repos/bustlelabs/content-kit-editor/commits{/sha}","git_commits_url":"https://api.github.com/repos/bustlelabs/content-kit-editor/git/commits{/sha}","comments_url":"https://api.github.com/repos/bustlelabs/content-kit-editor/comments{/number}","issue_comment_url":"https://api.github.com/repos/bustlelabs/content-kit-editor/issues/comments{/number}","contents_url":"https://api.github.com/repos/bustlelabs/content-kit-editor/contents/{+path}","compare_url":"https://api.github.com/repos/bustlelabs/content-kit-editor/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bustlelabs/content-kit-editor/merges","archive_url":"https://api.github.com/repos/bustlelabs/content-kit-editor/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bustlelabs/content-kit-editor/downloads","issues_url":"https://api.github.com/repos/bustlelabs/content-kit-editor/issues{/number}","pulls_url":"https://api.github.com/repos/bustlelabs/content-kit-editor/pulls{/number}","milestones_url":"https://api.github.com/repos/bustlelabs/content-kit-editor/milestones{/number}","notifications_url":"https://api.github.com/repos/bustlelabs/content-kit-editor/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bustlelabs/content-kit-editor/labels{/name}","releases_url":"https://api.github.com/repos/bustlelabs/content-kit-editor/releases{/id}","created_at":"2014-07-10T13:22:19Z","updated_at":"2015-06-28T23:50:32Z","pushed_at":"2015-07-19T16:48:44Z","git_url":"git://github.com/bustlelabs/content-kit-editor.git","ssh_url":"git@github.com:bustlelabs/content-kit-editor.git","clone_url":"https://github.com/bustlelabs/content-kit-editor.git","svn_url":"https://github.com/bustlelabs/content-kit-editor","homepage":"","size":1383,"stargazers_count":18,"watchers_count":18,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":3,"mirror_url":null,"open_issues_count":3,"forks":3,"open_issues":3,"watchers":18,"default_branch":"master"}},"base":{"label":"bustlelabs:summertime","ref":"summertime","sha":"5b59865a656f03f062e13827628ce38dffc9e870","user":{"login":"bustlelabs","id":2198187,"avatar_url":"https://avatars.githubusercontent.com/u/2198187?v=3","gravatar_id":"","url":"https://api.github.com/users/bustlelabs","html_url":"https://github.com/bustlelabs","followers_url":"https://api.github.com/users/bustlelabs/followers","following_url":"https://api.github.com/users/bustlelabs/following{/other_user}","gists_url":"https://api.github.com/users/bustlelabs/gists{/gist_id}","starred_url":"https://api.github.com/users/bustlelabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bustlelabs/subscriptions","organizations_url":"https://api.github.com/users/bustlelabs/orgs","repos_url":"https://api.github.com/users/bustlelabs/repos","events_url":"https://api.github.com/users/bustlelabs/events{/privacy}","received_events_url":"https://api.github.com/users/bustlelabs/received_events","type":"Organization","site_admin":false},"repo":{"id":21694966,"name":"content-kit-editor","full_name":"bustlelabs/content-kit-editor","owner":{"login":"bustlelabs","id":2198187,"avatar_url":"https://avatars.githubusercontent.com/u/2198187?v=3","gravatar_id":"","url":"https://api.github.com/users/bustlelabs","html_url":"https://github.com/bustlelabs","followers_url":"https://api.github.com/users/bustlelabs/followers","following_url":"https://api.github.com/users/bustlelabs/following{/other_user}","gists_url":"https://api.github.com/users/bustlelabs/gists{/gist_id}","starred_url":"https://api.github.com/users/bustlelabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bustlelabs/subscriptions","organizations_url":"https://api.github.com/users/bustlelabs/orgs","repos_url":"https://api.github.com/users/bustlelabs/repos","events_url":"https://api.github.com/users/bustlelabs/events{/privacy}","received_events_url":"https://api.github.com/users/bustlelabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/bustlelabs/content-kit-editor","description":"A modern, minimalist WYSIWYG editor","fork":false,"url":"https://api.github.com/repos/bustlelabs/content-kit-editor","forks_url":"https://api.github.com/repos/bustlelabs/content-kit-editor/forks","keys_url":"https://api.github.com/repos/bustlelabs/content-kit-editor/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bustlelabs/content-kit-editor/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bustlelabs/content-kit-editor/teams","hooks_url":"https://api.github.com/repos/bustlelabs/content-kit-editor/hooks","issue_events_url":"https://api.github.com/repos/bustlelabs/content-kit-editor/issues/events{/number}","events_url":"https://api.github.com/repos/bustlelabs/content-kit-editor/events","assignees_url":"https://api.github.com/repos/bustlelabs/content-kit-editor/assignees{/user}","branches_url":"https://api.github.com/repos/bustlelabs/content-kit-editor/branches{/branch}","tags_url":"https://api.github.com/repos/bustlelabs/content-kit-editor/tags","blobs_url":"https://api.github.com/repos/bustlelabs/content-kit-editor/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bustlelabs/content-kit-editor/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bustlelabs/content-kit-editor/git/refs{/sha}","trees_url":"https://api.github.com/repos/bustlelabs/content-kit-editor/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bustlelabs/content-kit-editor/statuses/{sha}","languages_url":"https://api.github.com/repos/bustlelabs/content-kit-editor/languages","stargazers_url":"https://api.github.com/repos/bustlelabs/content-kit-editor/stargazers","contributors_url":"https://api.github.com/repos/bustlelabs/content-kit-editor/contributors","subscribers_url":"https://api.github.com/repos/bustlelabs/content-kit-editor/subscribers","subscription_url":"https://api.github.com/repos/bustlelabs/content-kit-editor/subscription","commits_url":"https://api.github.com/repos/bustlelabs/content-kit-editor/commits{/sha}","git_commits_url":"https://api.github.com/repos/bustlelabs/content-kit-editor/git/commits{/sha}","comments_url":"https://api.github.com/repos/bustlelabs/content-kit-editor/comments{/number}","issue_comment_url":"https://api.github.com/repos/bustlelabs/content-kit-editor/issues/comments{/number}","contents_url":"https://api.github.com/repos/bustlelabs/content-kit-editor/contents/{+path}","compare_url":"https://api.github.com/repos/bustlelabs/content-kit-editor/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bustlelabs/content-kit-editor/merges","archive_url":"https://api.github.com/repos/bustlelabs/content-kit-editor/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bustlelabs/content-kit-editor/downloads","issues_url":"https://api.github.com/repos/bustlelabs/content-kit-editor/issues{/number}","pulls_url":"https://api.github.com/repos/bustlelabs/content-kit-editor/pulls{/number}","milestones_url":"https://api.github.com/repos/bustlelabs/content-kit-editor/milestones{/number}","notifications_url":"https://api.github.com/repos/bustlelabs/content-kit-editor/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bustlelabs/content-kit-editor/labels{/name}","releases_url":"https://api.github.com/repos/bustlelabs/content-kit-editor/releases{/id}","created_at":"2014-07-10T13:22:19Z","updated_at":"2015-06-28T23:50:32Z","pushed_at":"2015-07-19T16:48:44Z","git_url":"git://github.com/bustlelabs/content-kit-editor.git","ssh_url":"git@github.com:bustlelabs/content-kit-editor.git","clone_url":"https://github.com/bustlelabs/content-kit-editor.git","svn_url":"https://github.com/bustlelabs/content-kit-editor","homepage":"","size":1383,"stargazers_count":18,"watchers_count":18,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":3,"mirror_url":null,"open_issues_count":3,"forks":3,"open_issues":3,"watchers":18,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/bustlelabs/content-kit-editor/pulls/23"},"html":{"href":"https://github.com/bustlelabs/content-kit-editor/pull/23"},"issue":{"href":"https://api.github.com/repos/bustlelabs/content-kit-editor/issues/23"},"comments":{"href":"https://api.github.com/repos/bustlelabs/content-kit-editor/issues/23/comments"},"review_comments":{"href":"https://api.github.com/repos/bustlelabs/content-kit-editor/pulls/23/comments"},"review_comment":{"href":"https://api.github.com/repos/bustlelabs/content-kit-editor/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/bustlelabs/content-kit-editor/pulls/23/commits"},"statuses":{"href":"https://api.github.com/repos/bustlelabs/content-kit-editor/statuses/63b8fbfe809f78637ef4320bede9b80baf5f2ca4"}}}}