{"action":"opened","number":2,"pull_request":{"url":"https://api.github.com/repos/cdauth/htmldiff/pulls/2","id":52478594,"html_url":"https://github.com/cdauth/htmldiff/pull/2","diff_url":"https://github.com/cdauth/htmldiff/pull/2.diff","patch_url":"https://github.com/cdauth/htmldiff/pull/2.patch","issue_url":"https://api.github.com/repos/cdauth/htmldiff/issues/2","number":2,"state":"open","locked":false,"title":"Fix splitUntil","user":{"login":"jabouillei","id":898515,"avatar_url":"https://avatars.githubusercontent.com/u/898515?v=3","gravatar_id":"","url":"https://api.github.com/users/jabouillei","html_url":"https://github.com/jabouillei","followers_url":"https://api.github.com/users/jabouillei/followers","following_url":"https://api.github.com/users/jabouillei/following{/other_user}","gists_url":"https://api.github.com/users/jabouillei/gists{/gist_id}","starred_url":"https://api.github.com/users/jabouillei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jabouillei/subscriptions","organizations_url":"https://api.github.com/users/jabouillei/orgs","repos_url":"https://api.github.com/users/jabouillei/repos","events_url":"https://api.github.com/users/jabouillei/events{/privacy}","received_events_url":"https://api.github.com/users/jabouillei/received_events","type":"User","site_admin":false},"body":"splitUntil() tries to replace \"original\" with \"part1 part2\", but before this commit, it took actions in the wrong order.  It added part1, then added part2, then removed original.  For example:\r\na b original c d\r\nbecome\r\na b part1 original c d\r\nthen\r\na b part2 part1 original c d\r\nthen\r\na b part1 original c d\r\nThis commit changes the function to first remove original, then add part2, then add part1:\r\na b c d\r\na b part2 c d\r\na b part1 part2 c d\r\n\r\nHere is an example problem at the application level:\r\n<?php\r\nrequire_once('htmldiff/html_diff.php');\r\n\r\n$old=\"<span>Sentence</span><br/>\r\n<p>These word</p>\";\r\n\r\n$new=\"Sentence <br/>\r\n<p><strong>These words</strong></p>\";\r\n\r\necho html_diff($old, $new).\"\\n\";\r\n?>","created_at":"2015-12-03T01:04:49Z","updated_at":"2015-12-03T01:04:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/cdauth/htmldiff/pulls/2/commits","review_comments_url":"https://api.github.com/repos/cdauth/htmldiff/pulls/2/comments","review_comment_url":"https://api.github.com/repos/cdauth/htmldiff/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cdauth/htmldiff/issues/2/comments","statuses_url":"https://api.github.com/repos/cdauth/htmldiff/statuses/4a3e14f322b179e361fb2ee17b7aead23de1ac7d","head":{"label":"jabouillei:master","ref":"master","sha":"4a3e14f322b179e361fb2ee17b7aead23de1ac7d","user":{"login":"jabouillei","id":898515,"avatar_url":"https://avatars.githubusercontent.com/u/898515?v=3","gravatar_id":"","url":"https://api.github.com/users/jabouillei","html_url":"https://github.com/jabouillei","followers_url":"https://api.github.com/users/jabouillei/followers","following_url":"https://api.github.com/users/jabouillei/following{/other_user}","gists_url":"https://api.github.com/users/jabouillei/gists{/gist_id}","starred_url":"https://api.github.com/users/jabouillei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jabouillei/subscriptions","organizations_url":"https://api.github.com/users/jabouillei/orgs","repos_url":"https://api.github.com/users/jabouillei/repos","events_url":"https://api.github.com/users/jabouillei/events{/privacy}","received_events_url":"https://api.github.com/users/jabouillei/received_events","type":"User","site_admin":false},"repo":{"id":47297682,"name":"htmldiff","full_name":"jabouillei/htmldiff","owner":{"login":"jabouillei","id":898515,"avatar_url":"https://avatars.githubusercontent.com/u/898515?v=3","gravatar_id":"","url":"https://api.github.com/users/jabouillei","html_url":"https://github.com/jabouillei","followers_url":"https://api.github.com/users/jabouillei/followers","following_url":"https://api.github.com/users/jabouillei/following{/other_user}","gists_url":"https://api.github.com/users/jabouillei/gists{/gist_id}","starred_url":"https://api.github.com/users/jabouillei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jabouillei/subscriptions","organizations_url":"https://api.github.com/users/jabouillei/orgs","repos_url":"https://api.github.com/users/jabouillei/repos","events_url":"https://api.github.com/users/jabouillei/events{/privacy}","received_events_url":"https://api.github.com/users/jabouillei/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jabouillei/htmldiff","description":"Calculate the difference between two HTML snippets","fork":true,"url":"https://api.github.com/repos/jabouillei/htmldiff","forks_url":"https://api.github.com/repos/jabouillei/htmldiff/forks","keys_url":"https://api.github.com/repos/jabouillei/htmldiff/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jabouillei/htmldiff/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jabouillei/htmldiff/teams","hooks_url":"https://api.github.com/repos/jabouillei/htmldiff/hooks","issue_events_url":"https://api.github.com/repos/jabouillei/htmldiff/issues/events{/number}","events_url":"https://api.github.com/repos/jabouillei/htmldiff/events","assignees_url":"https://api.github.com/repos/jabouillei/htmldiff/assignees{/user}","branches_url":"https://api.github.com/repos/jabouillei/htmldiff/branches{/branch}","tags_url":"https://api.github.com/repos/jabouillei/htmldiff/tags","blobs_url":"https://api.github.com/repos/jabouillei/htmldiff/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jabouillei/htmldiff/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jabouillei/htmldiff/git/refs{/sha}","trees_url":"https://api.github.com/repos/jabouillei/htmldiff/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jabouillei/htmldiff/statuses/{sha}","languages_url":"https://api.github.com/repos/jabouillei/htmldiff/languages","stargazers_url":"https://api.github.com/repos/jabouillei/htmldiff/stargazers","contributors_url":"https://api.github.com/repos/jabouillei/htmldiff/contributors","subscribers_url":"https://api.github.com/repos/jabouillei/htmldiff/subscribers","subscription_url":"https://api.github.com/repos/jabouillei/htmldiff/subscription","commits_url":"https://api.github.com/repos/jabouillei/htmldiff/commits{/sha}","git_commits_url":"https://api.github.com/repos/jabouillei/htmldiff/git/commits{/sha}","comments_url":"https://api.github.com/repos/jabouillei/htmldiff/comments{/number}","issue_comment_url":"https://api.github.com/repos/jabouillei/htmldiff/issues/comments{/number}","contents_url":"https://api.github.com/repos/jabouillei/htmldiff/contents/{+path}","compare_url":"https://api.github.com/repos/jabouillei/htmldiff/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jabouillei/htmldiff/merges","archive_url":"https://api.github.com/repos/jabouillei/htmldiff/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jabouillei/htmldiff/downloads","issues_url":"https://api.github.com/repos/jabouillei/htmldiff/issues{/number}","pulls_url":"https://api.github.com/repos/jabouillei/htmldiff/pulls{/number}","milestones_url":"https://api.github.com/repos/jabouillei/htmldiff/milestones{/number}","notifications_url":"https://api.github.com/repos/jabouillei/htmldiff/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jabouillei/htmldiff/labels{/name}","releases_url":"https://api.github.com/repos/jabouillei/htmldiff/releases{/id}","created_at":"2015-12-03T00:46:59Z","updated_at":"2015-12-03T00:46:59Z","pushed_at":"2015-12-03T01:00:16Z","git_url":"git://github.com/jabouillei/htmldiff.git","ssh_url":"git@github.com:jabouillei/htmldiff.git","clone_url":"https://github.com/jabouillei/htmldiff.git","svn_url":"https://github.com/jabouillei/htmldiff","homepage":null,"size":43,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"cdauth:master","ref":"master","sha":"ab52b277f7a63a0e90a65717d4f98e4e92d9e830","user":{"login":"cdauth","id":1801792,"avatar_url":"https://avatars.githubusercontent.com/u/1801792?v=3","gravatar_id":"","url":"https://api.github.com/users/cdauth","html_url":"https://github.com/cdauth","followers_url":"https://api.github.com/users/cdauth/followers","following_url":"https://api.github.com/users/cdauth/following{/other_user}","gists_url":"https://api.github.com/users/cdauth/gists{/gist_id}","starred_url":"https://api.github.com/users/cdauth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cdauth/subscriptions","organizations_url":"https://api.github.com/users/cdauth/orgs","repos_url":"https://api.github.com/users/cdauth/repos","events_url":"https://api.github.com/users/cdauth/events{/privacy}","received_events_url":"https://api.github.com/users/cdauth/received_events","type":"User","site_admin":false},"repo":{"id":33449358,"name":"htmldiff","full_name":"cdauth/htmldiff","owner":{"login":"cdauth","id":1801792,"avatar_url":"https://avatars.githubusercontent.com/u/1801792?v=3","gravatar_id":"","url":"https://api.github.com/users/cdauth","html_url":"https://github.com/cdauth","followers_url":"https://api.github.com/users/cdauth/followers","following_url":"https://api.github.com/users/cdauth/following{/other_user}","gists_url":"https://api.github.com/users/cdauth/gists{/gist_id}","starred_url":"https://api.github.com/users/cdauth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cdauth/subscriptions","organizations_url":"https://api.github.com/users/cdauth/orgs","repos_url":"https://api.github.com/users/cdauth/repos","events_url":"https://api.github.com/users/cdauth/events{/privacy}","received_events_url":"https://api.github.com/users/cdauth/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cdauth/htmldiff","description":"Calculate the difference between two HTML snippets","fork":false,"url":"https://api.github.com/repos/cdauth/htmldiff","forks_url":"https://api.github.com/repos/cdauth/htmldiff/forks","keys_url":"https://api.github.com/repos/cdauth/htmldiff/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cdauth/htmldiff/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cdauth/htmldiff/teams","hooks_url":"https://api.github.com/repos/cdauth/htmldiff/hooks","issue_events_url":"https://api.github.com/repos/cdauth/htmldiff/issues/events{/number}","events_url":"https://api.github.com/repos/cdauth/htmldiff/events","assignees_url":"https://api.github.com/repos/cdauth/htmldiff/assignees{/user}","branches_url":"https://api.github.com/repos/cdauth/htmldiff/branches{/branch}","tags_url":"https://api.github.com/repos/cdauth/htmldiff/tags","blobs_url":"https://api.github.com/repos/cdauth/htmldiff/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cdauth/htmldiff/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cdauth/htmldiff/git/refs{/sha}","trees_url":"https://api.github.com/repos/cdauth/htmldiff/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cdauth/htmldiff/statuses/{sha}","languages_url":"https://api.github.com/repos/cdauth/htmldiff/languages","stargazers_url":"https://api.github.com/repos/cdauth/htmldiff/stargazers","contributors_url":"https://api.github.com/repos/cdauth/htmldiff/contributors","subscribers_url":"https://api.github.com/repos/cdauth/htmldiff/subscribers","subscription_url":"https://api.github.com/repos/cdauth/htmldiff/subscription","commits_url":"https://api.github.com/repos/cdauth/htmldiff/commits{/sha}","git_commits_url":"https://api.github.com/repos/cdauth/htmldiff/git/commits{/sha}","comments_url":"https://api.github.com/repos/cdauth/htmldiff/comments{/number}","issue_comment_url":"https://api.github.com/repos/cdauth/htmldiff/issues/comments{/number}","contents_url":"https://api.github.com/repos/cdauth/htmldiff/contents/{+path}","compare_url":"https://api.github.com/repos/cdauth/htmldiff/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cdauth/htmldiff/merges","archive_url":"https://api.github.com/repos/cdauth/htmldiff/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cdauth/htmldiff/downloads","issues_url":"https://api.github.com/repos/cdauth/htmldiff/issues{/number}","pulls_url":"https://api.github.com/repos/cdauth/htmldiff/pulls{/number}","milestones_url":"https://api.github.com/repos/cdauth/htmldiff/milestones{/number}","notifications_url":"https://api.github.com/repos/cdauth/htmldiff/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cdauth/htmldiff/labels{/name}","releases_url":"https://api.github.com/repos/cdauth/htmldiff/releases{/id}","created_at":"2015-04-05T17:44:39Z","updated_at":"2015-11-14T18:58:08Z","pushed_at":"2015-12-03T01:04:49Z","git_url":"git://github.com/cdauth/htmldiff.git","ssh_url":"git@github.com:cdauth/htmldiff.git","clone_url":"https://github.com/cdauth/htmldiff.git","svn_url":"https://github.com/cdauth/htmldiff","homepage":null,"size":163,"stargazers_count":6,"watchers_count":6,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":1,"forks":2,"open_issues":1,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cdauth/htmldiff/pulls/2"},"html":{"href":"https://github.com/cdauth/htmldiff/pull/2"},"issue":{"href":"https://api.github.com/repos/cdauth/htmldiff/issues/2"},"comments":{"href":"https://api.github.com/repos/cdauth/htmldiff/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/cdauth/htmldiff/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/cdauth/htmldiff/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cdauth/htmldiff/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/cdauth/htmldiff/statuses/4a3e14f322b179e361fb2ee17b7aead23de1ac7d"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":8,"deletions":5,"changed_files":1}}