{"action":"created","comment":{"url":"https://api.github.com/repos/daviferreira/medium-editor/pulls/comments/23226057","id":23226057,"diff_hunk":"@@ -67,6 +67,7 @@ If you want to support IE9, you will need to use a classList pollyfill, like Eli\n * __forcePlainText__: Forces pasting as plain text. Default: true\n * __placeholder__: Defines the default placeholder for empty contenteditables when __disablePlaceholders__ is not set to true. You can overwrite it by setting a data-placeholder attribute on your elements. Default: 'Type your text'\n * __secondHeader__: HTML tag to be used as second header. Default: h4\n+* __standardizeSelectionStart__: Standardizes how the beginning of a range is decided between browsers whenever the selected text is analyzed for updating toolbar buttons status","path":"README.md","position":4,"original_position":4,"commit_id":"83c2a1eb562e6fec3059641ee6f0f948912bc15d","original_commit_id":"18ea88131c1c8ca1511e036486faa75b873e2aff","user":{"login":"nchase","id":197309,"avatar_url":"https://avatars.githubusercontent.com/u/197309?v=3","gravatar_id":"","url":"https://api.github.com/users/nchase","html_url":"https://github.com/nchase","followers_url":"https://api.github.com/users/nchase/followers","following_url":"https://api.github.com/users/nchase/following{/other_user}","gists_url":"https://api.github.com/users/nchase/gists{/gist_id}","starred_url":"https://api.github.com/users/nchase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nchase/subscriptions","organizations_url":"https://api.github.com/users/nchase/orgs","repos_url":"https://api.github.com/users/nchase/repos","events_url":"https://api.github.com/users/nchase/events{/privacy}","received_events_url":"https://api.github.com/users/nchase/received_events","type":"User","site_admin":false},"body":"one thing that could be done to increase the certainty here would be to run tests against Sauce Labs in addition to the travis-ci/phantomJS build that happens now.  Sauce Labs will run tests on any browser  – and it's free for open source projects like this one. https://saucelabs.com/opensauce","created_at":"2015-01-20T14:46:34Z","updated_at":"2015-01-20T14:46:34Z","html_url":"https://github.com/daviferreira/medium-editor/pull/370#discussion_r23226057","pull_request_url":"https://api.github.com/repos/daviferreira/medium-editor/pulls/370","_links":{"self":{"href":"https://api.github.com/repos/daviferreira/medium-editor/pulls/comments/23226057"},"html":{"href":"https://github.com/daviferreira/medium-editor/pull/370#discussion_r23226057"},"pull_request":{"href":"https://api.github.com/repos/daviferreira/medium-editor/pulls/370"}}},"pull_request":{"url":"https://api.github.com/repos/daviferreira/medium-editor/pulls/370","id":27681917,"html_url":"https://github.com/daviferreira/medium-editor/pull/370","diff_url":"https://github.com/daviferreira/medium-editor/pull/370.diff","patch_url":"https://github.com/daviferreira/medium-editor/pull/370.patch","issue_url":"https://api.github.com/repos/daviferreira/medium-editor/issues/370","number":370,"state":"open","locked":false,"title":"Standardize where in the DOM a range begins","user":{"login":"nmielnik","id":2444240,"avatar_url":"https://avatars.githubusercontent.com/u/2444240?v=3","gravatar_id":"","url":"https://api.github.com/users/nmielnik","html_url":"https://github.com/nmielnik","followers_url":"https://api.github.com/users/nmielnik/followers","following_url":"https://api.github.com/users/nmielnik/following{/other_user}","gists_url":"https://api.github.com/users/nmielnik/gists{/gist_id}","starred_url":"https://api.github.com/users/nmielnik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nmielnik/subscriptions","organizations_url":"https://api.github.com/users/nmielnik/orgs","repos_url":"https://api.github.com/users/nmielnik/repos","events_url":"https://api.github.com/users/nmielnik/events{/privacy}","received_events_url":"https://api.github.com/users/nmielnik/received_events","type":"User","site_admin":false},"body":"In firefox, there are cases (ie doubleclick of a word) where the selectionRange start will be at the very end of an element.  In other browsers, the selectionRange start would instead be at the very beginning of an element that actually has content.\r\n\r\nexample:\r\n```\r\n<div contenteditable=\"true\">\r\n    <span>foo</span><span>bar</span>\r\n</div>\r\n````\r\nIf the text `bar` is selected, most browsers will have the selectionRange start at the beginning of the `bar` span.  However, there are cases where firefox will have the selectionRange start at the end of the `foo` span.  The contenteditable behavior will be ok, but if there are any properties on the `bar` span, they won't be reflected accurately in the toolbar (ie 'Bold' button wouldn't be active)\r\n\r\nSo, for cases where the selectionRange start is at the end of an element/node, find the next adjacent text node that actually has content in it, and move the selectionRange start there.\r\n\r\nWe can find the next non-empty text node using the native NodeIterator (which should be supported in all browsers and IE9+)","created_at":"2015-01-20T14:39:26Z","updated_at":"2015-01-20T14:46:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2f570490d3489f29056c0e5d846fe92297cb3925","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/daviferreira/medium-editor/pulls/370/commits","review_comments_url":"https://api.github.com/repos/daviferreira/medium-editor/pulls/370/comments","review_comment_url":"https://api.github.com/repos/daviferreira/medium-editor/pulls/comments/{number}","comments_url":"https://api.github.com/repos/daviferreira/medium-editor/issues/370/comments","statuses_url":"https://api.github.com/repos/daviferreira/medium-editor/statuses/83c2a1eb562e6fec3059641ee6f0f948912bc15d","head":{"label":"nmielnik:standardize-selection-start","ref":"standardize-selection-start","sha":"83c2a1eb562e6fec3059641ee6f0f948912bc15d","user":{"login":"nmielnik","id":2444240,"avatar_url":"https://avatars.githubusercontent.com/u/2444240?v=3","gravatar_id":"","url":"https://api.github.com/users/nmielnik","html_url":"https://github.com/nmielnik","followers_url":"https://api.github.com/users/nmielnik/followers","following_url":"https://api.github.com/users/nmielnik/following{/other_user}","gists_url":"https://api.github.com/users/nmielnik/gists{/gist_id}","starred_url":"https://api.github.com/users/nmielnik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nmielnik/subscriptions","organizations_url":"https://api.github.com/users/nmielnik/orgs","repos_url":"https://api.github.com/users/nmielnik/repos","events_url":"https://api.github.com/users/nmielnik/events{/privacy}","received_events_url":"https://api.github.com/users/nmielnik/received_events","type":"User","site_admin":false},"repo":{"id":28637982,"name":"medium-editor","full_name":"nmielnik/medium-editor","owner":{"login":"nmielnik","id":2444240,"avatar_url":"https://avatars.githubusercontent.com/u/2444240?v=3","gravatar_id":"","url":"https://api.github.com/users/nmielnik","html_url":"https://github.com/nmielnik","followers_url":"https://api.github.com/users/nmielnik/followers","following_url":"https://api.github.com/users/nmielnik/following{/other_user}","gists_url":"https://api.github.com/users/nmielnik/gists{/gist_id}","starred_url":"https://api.github.com/users/nmielnik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nmielnik/subscriptions","organizations_url":"https://api.github.com/users/nmielnik/orgs","repos_url":"https://api.github.com/users/nmielnik/repos","events_url":"https://api.github.com/users/nmielnik/events{/privacy}","received_events_url":"https://api.github.com/users/nmielnik/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nmielnik/medium-editor","description":"Medium.com WYSIWYG editor clone.","fork":true,"url":"https://api.github.com/repos/nmielnik/medium-editor","forks_url":"https://api.github.com/repos/nmielnik/medium-editor/forks","keys_url":"https://api.github.com/repos/nmielnik/medium-editor/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nmielnik/medium-editor/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nmielnik/medium-editor/teams","hooks_url":"https://api.github.com/repos/nmielnik/medium-editor/hooks","issue_events_url":"https://api.github.com/repos/nmielnik/medium-editor/issues/events{/number}","events_url":"https://api.github.com/repos/nmielnik/medium-editor/events","assignees_url":"https://api.github.com/repos/nmielnik/medium-editor/assignees{/user}","branches_url":"https://api.github.com/repos/nmielnik/medium-editor/branches{/branch}","tags_url":"https://api.github.com/repos/nmielnik/medium-editor/tags","blobs_url":"https://api.github.com/repos/nmielnik/medium-editor/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nmielnik/medium-editor/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nmielnik/medium-editor/git/refs{/sha}","trees_url":"https://api.github.com/repos/nmielnik/medium-editor/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nmielnik/medium-editor/statuses/{sha}","languages_url":"https://api.github.com/repos/nmielnik/medium-editor/languages","stargazers_url":"https://api.github.com/repos/nmielnik/medium-editor/stargazers","contributors_url":"https://api.github.com/repos/nmielnik/medium-editor/contributors","subscribers_url":"https://api.github.com/repos/nmielnik/medium-editor/subscribers","subscription_url":"https://api.github.com/repos/nmielnik/medium-editor/subscription","commits_url":"https://api.github.com/repos/nmielnik/medium-editor/commits{/sha}","git_commits_url":"https://api.github.com/repos/nmielnik/medium-editor/git/commits{/sha}","comments_url":"https://api.github.com/repos/nmielnik/medium-editor/comments{/number}","issue_comment_url":"https://api.github.com/repos/nmielnik/medium-editor/issues/comments/{number}","contents_url":"https://api.github.com/repos/nmielnik/medium-editor/contents/{+path}","compare_url":"https://api.github.com/repos/nmielnik/medium-editor/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nmielnik/medium-editor/merges","archive_url":"https://api.github.com/repos/nmielnik/medium-editor/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nmielnik/medium-editor/downloads","issues_url":"https://api.github.com/repos/nmielnik/medium-editor/issues{/number}","pulls_url":"https://api.github.com/repos/nmielnik/medium-editor/pulls{/number}","milestones_url":"https://api.github.com/repos/nmielnik/medium-editor/milestones{/number}","notifications_url":"https://api.github.com/repos/nmielnik/medium-editor/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nmielnik/medium-editor/labels{/name}","releases_url":"https://api.github.com/repos/nmielnik/medium-editor/releases{/id}","created_at":"2014-12-30T16:45:04Z","updated_at":"2015-01-19T16:48:57Z","pushed_at":"2015-01-20T14:43:33Z","git_url":"git://github.com/nmielnik/medium-editor.git","ssh_url":"git@github.com:nmielnik/medium-editor.git","clone_url":"https://github.com/nmielnik/medium-editor.git","svn_url":"https://github.com/nmielnik/medium-editor","homepage":"http://daviferreira.github.io/medium-editor/","size":2428,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"daviferreira:master","ref":"master","sha":"edf08ba48c80b92e9865da0ba14f35ff18cd40ed","user":{"login":"daviferreira","id":38787,"avatar_url":"https://avatars.githubusercontent.com/u/38787?v=3","gravatar_id":"","url":"https://api.github.com/users/daviferreira","html_url":"https://github.com/daviferreira","followers_url":"https://api.github.com/users/daviferreira/followers","following_url":"https://api.github.com/users/daviferreira/following{/other_user}","gists_url":"https://api.github.com/users/daviferreira/gists{/gist_id}","starred_url":"https://api.github.com/users/daviferreira/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daviferreira/subscriptions","organizations_url":"https://api.github.com/users/daviferreira/orgs","repos_url":"https://api.github.com/users/daviferreira/repos","events_url":"https://api.github.com/users/daviferreira/events{/privacy}","received_events_url":"https://api.github.com/users/daviferreira/received_events","type":"User","site_admin":false},"repo":{"id":10365411,"name":"medium-editor","full_name":"daviferreira/medium-editor","owner":{"login":"daviferreira","id":38787,"avatar_url":"https://avatars.githubusercontent.com/u/38787?v=3","gravatar_id":"","url":"https://api.github.com/users/daviferreira","html_url":"https://github.com/daviferreira","followers_url":"https://api.github.com/users/daviferreira/followers","following_url":"https://api.github.com/users/daviferreira/following{/other_user}","gists_url":"https://api.github.com/users/daviferreira/gists{/gist_id}","starred_url":"https://api.github.com/users/daviferreira/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daviferreira/subscriptions","organizations_url":"https://api.github.com/users/daviferreira/orgs","repos_url":"https://api.github.com/users/daviferreira/repos","events_url":"https://api.github.com/users/daviferreira/events{/privacy}","received_events_url":"https://api.github.com/users/daviferreira/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/daviferreira/medium-editor","description":"Medium.com WYSIWYG editor clone.","fork":false,"url":"https://api.github.com/repos/daviferreira/medium-editor","forks_url":"https://api.github.com/repos/daviferreira/medium-editor/forks","keys_url":"https://api.github.com/repos/daviferreira/medium-editor/keys{/key_id}","collaborators_url":"https://api.github.com/repos/daviferreira/medium-editor/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/daviferreira/medium-editor/teams","hooks_url":"https://api.github.com/repos/daviferreira/medium-editor/hooks","issue_events_url":"https://api.github.com/repos/daviferreira/medium-editor/issues/events{/number}","events_url":"https://api.github.com/repos/daviferreira/medium-editor/events","assignees_url":"https://api.github.com/repos/daviferreira/medium-editor/assignees{/user}","branches_url":"https://api.github.com/repos/daviferreira/medium-editor/branches{/branch}","tags_url":"https://api.github.com/repos/daviferreira/medium-editor/tags","blobs_url":"https://api.github.com/repos/daviferreira/medium-editor/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/daviferreira/medium-editor/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/daviferreira/medium-editor/git/refs{/sha}","trees_url":"https://api.github.com/repos/daviferreira/medium-editor/git/trees{/sha}","statuses_url":"https://api.github.com/repos/daviferreira/medium-editor/statuses/{sha}","languages_url":"https://api.github.com/repos/daviferreira/medium-editor/languages","stargazers_url":"https://api.github.com/repos/daviferreira/medium-editor/stargazers","contributors_url":"https://api.github.com/repos/daviferreira/medium-editor/contributors","subscribers_url":"https://api.github.com/repos/daviferreira/medium-editor/subscribers","subscription_url":"https://api.github.com/repos/daviferreira/medium-editor/subscription","commits_url":"https://api.github.com/repos/daviferreira/medium-editor/commits{/sha}","git_commits_url":"https://api.github.com/repos/daviferreira/medium-editor/git/commits{/sha}","comments_url":"https://api.github.com/repos/daviferreira/medium-editor/comments{/number}","issue_comment_url":"https://api.github.com/repos/daviferreira/medium-editor/issues/comments/{number}","contents_url":"https://api.github.com/repos/daviferreira/medium-editor/contents/{+path}","compare_url":"https://api.github.com/repos/daviferreira/medium-editor/compare/{base}...{head}","merges_url":"https://api.github.com/repos/daviferreira/medium-editor/merges","archive_url":"https://api.github.com/repos/daviferreira/medium-editor/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/daviferreira/medium-editor/downloads","issues_url":"https://api.github.com/repos/daviferreira/medium-editor/issues{/number}","pulls_url":"https://api.github.com/repos/daviferreira/medium-editor/pulls{/number}","milestones_url":"https://api.github.com/repos/daviferreira/medium-editor/milestones{/number}","notifications_url":"https://api.github.com/repos/daviferreira/medium-editor/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/daviferreira/medium-editor/labels{/name}","releases_url":"https://api.github.com/repos/daviferreira/medium-editor/releases{/id}","created_at":"2013-05-29T17:40:11Z","updated_at":"2015-01-20T12:59:21Z","pushed_at":"2015-01-16T16:21:47Z","git_url":"git://github.com/daviferreira/medium-editor.git","ssh_url":"git@github.com:daviferreira/medium-editor.git","clone_url":"https://github.com/daviferreira/medium-editor.git","svn_url":"https://github.com/daviferreira/medium-editor","homepage":"http://daviferreira.github.io/medium-editor/","size":4827,"stargazers_count":4353,"watchers_count":4353,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":502,"mirror_url":null,"open_issues_count":97,"forks":502,"open_issues":97,"watchers":4353,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/daviferreira/medium-editor/pulls/370"},"html":{"href":"https://github.com/daviferreira/medium-editor/pull/370"},"issue":{"href":"https://api.github.com/repos/daviferreira/medium-editor/issues/370"},"comments":{"href":"https://api.github.com/repos/daviferreira/medium-editor/issues/370/comments"},"review_comments":{"href":"https://api.github.com/repos/daviferreira/medium-editor/pulls/370/comments"},"review_comment":{"href":"https://api.github.com/repos/daviferreira/medium-editor/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/daviferreira/medium-editor/pulls/370/commits"},"statuses":{"href":"https://api.github.com/repos/daviferreira/medium-editor/statuses/83c2a1eb562e6fec3059641ee6f0f948912bc15d"}}}}