{"action":"created","comment":{"url":"https://api.github.com/repos/yahoo/context-parser/pulls/comments/32395945","id":32395945,"diff_hunk":"@@ -287,8 +301,10 @@ FastParser.prototype.lookupChar = function(ch) {\n FastParser.prototype.contextualize = function(input, endsWithEOF) {\n     var self = this, listeners = self.listeners, i = -1, lastState;\n \n-    self.input = input;\n-    self.inputLen = input.length;\n+    // Perform input stream preprocessing\n+    // Reference: https://html.spec.whatwg.org/multipage/syntax.html#preprocessing-the-input-stream\n+    self.input = self.config.enableInputPreProcessing ? input.replace(reInputPreProcessing, function(m){return m[0] === '\\r' ? '\\n' : '\\uFFFD';}) : input;","path":"src/context-parser.js","position":56,"original_position":56,"commit_id":"3ecf7a4ca216fa2e611a8f036b0357ea1aabd2a8","original_commit_id":"3ecf7a4ca216fa2e611a8f036b0357ea1aabd2a8","user":{"login":"adon-at-work","id":8486533,"avatar_url":"https://avatars.githubusercontent.com/u/8486533?v=3","gravatar_id":"","url":"https://api.github.com/users/adon-at-work","html_url":"https://github.com/adon-at-work","followers_url":"https://api.github.com/users/adon-at-work/followers","following_url":"https://api.github.com/users/adon-at-work/following{/other_user}","gists_url":"https://api.github.com/users/adon-at-work/gists{/gist_id}","starred_url":"https://api.github.com/users/adon-at-work/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adon-at-work/subscriptions","organizations_url":"https://api.github.com/users/adon-at-work/orgs","repos_url":"https://api.github.com/users/adon-at-work/repos","events_url":"https://api.github.com/users/adon-at-work/events{/privacy}","received_events_url":"https://api.github.com/users/adon-at-work/received_events","type":"User","site_admin":false},"body":"batch replacement. input stream pre-processing does not depend on state.","created_at":"2015-06-15T07:16:59Z","updated_at":"2015-06-15T07:16:59Z","html_url":"https://github.com/yahoo/context-parser/pull/27#discussion_r32395945","pull_request_url":"https://api.github.com/repos/yahoo/context-parser/pulls/27","_links":{"self":{"href":"https://api.github.com/repos/yahoo/context-parser/pulls/comments/32395945"},"html":{"href":"https://github.com/yahoo/context-parser/pull/27#discussion_r32395945"},"pull_request":{"href":"https://api.github.com/repos/yahoo/context-parser/pulls/27"}}},"pull_request":{"url":"https://api.github.com/repos/yahoo/context-parser/pulls/27","id":37534293,"html_url":"https://github.com/yahoo/context-parser/pull/27","diff_url":"https://github.com/yahoo/context-parser/pull/27.diff","patch_url":"https://github.com/yahoo/context-parser/pull/27.patch","issue_url":"https://api.github.com/repos/yahoo/context-parser/issues/27","number":27,"state":"open","locked":false,"title":"Apply input preprocessing by default","user":{"login":"adon-at-work","id":8486533,"avatar_url":"https://avatars.githubusercontent.com/u/8486533?v=3","gravatar_id":"","url":"https://api.github.com/users/adon-at-work","html_url":"https://github.com/adon-at-work","followers_url":"https://api.github.com/users/adon-at-work/followers","following_url":"https://api.github.com/users/adon-at-work/following{/other_user}","gists_url":"https://api.github.com/users/adon-at-work/gists{/gist_id}","starred_url":"https://api.github.com/users/adon-at-work/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adon-at-work/subscriptions","organizations_url":"https://api.github.com/users/adon-at-work/orgs","repos_url":"https://api.github.com/users/adon-at-work/repos","events_url":"https://api.github.com/users/adon-at-work/events{/privacy}","received_events_url":"https://api.github.com/users/adon-at-work/received_events","type":"User","site_admin":false},"body":"- This is to conform with the html 5 specification, and is thus turned\r\non by default. Reference:\r\nhttps://html.spec.whatwg.org/multipage/syntax.html#preprocessing-the-input-stream\r\n- The implementation incurs negligible performance hit (from 25.60MB/s\r\nto 25.52MB/s, averaged over 5 times of running ./bin/benchmark)\r\n- This implementation is arrived after comparing\r\nregexp and char-by-char replacement.\r\n- Given there are negligible performance overhead, extended and turned it on by default even for FastParser","created_at":"2015-06-12T06:04:37Z","updated_at":"2015-06-15T07:16:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6ebc3709d43f04b9adf8f0185df3299c7404192e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/yahoo/context-parser/pulls/27/commits","review_comments_url":"https://api.github.com/repos/yahoo/context-parser/pulls/27/comments","review_comment_url":"https://api.github.com/repos/yahoo/context-parser/pulls/comments{/number}","comments_url":"https://api.github.com/repos/yahoo/context-parser/issues/27/comments","statuses_url":"https://api.github.com/repos/yahoo/context-parser/statuses/3ecf7a4ca216fa2e611a8f036b0357ea1aabd2a8","head":{"label":"yahoo:apply-input-preprocessing-by-default","ref":"apply-input-preprocessing-by-default","sha":"3ecf7a4ca216fa2e611a8f036b0357ea1aabd2a8","user":{"login":"yahoo","id":16574,"avatar_url":"https://avatars.githubusercontent.com/u/16574?v=3","gravatar_id":"","url":"https://api.github.com/users/yahoo","html_url":"https://github.com/yahoo","followers_url":"https://api.github.com/users/yahoo/followers","following_url":"https://api.github.com/users/yahoo/following{/other_user}","gists_url":"https://api.github.com/users/yahoo/gists{/gist_id}","starred_url":"https://api.github.com/users/yahoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yahoo/subscriptions","organizations_url":"https://api.github.com/users/yahoo/orgs","repos_url":"https://api.github.com/users/yahoo/repos","events_url":"https://api.github.com/users/yahoo/events{/privacy}","received_events_url":"https://api.github.com/users/yahoo/received_events","type":"Organization","site_admin":false},"repo":{"id":30554328,"name":"context-parser","full_name":"yahoo/context-parser","owner":{"login":"yahoo","id":16574,"avatar_url":"https://avatars.githubusercontent.com/u/16574?v=3","gravatar_id":"","url":"https://api.github.com/users/yahoo","html_url":"https://github.com/yahoo","followers_url":"https://api.github.com/users/yahoo/followers","following_url":"https://api.github.com/users/yahoo/following{/other_user}","gists_url":"https://api.github.com/users/yahoo/gists{/gist_id}","starred_url":"https://api.github.com/users/yahoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yahoo/subscriptions","organizations_url":"https://api.github.com/users/yahoo/orgs","repos_url":"https://api.github.com/users/yahoo/repos","events_url":"https://api.github.com/users/yahoo/events{/privacy}","received_events_url":"https://api.github.com/users/yahoo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/yahoo/context-parser","description":"HTML5 Context Parser","fork":false,"url":"https://api.github.com/repos/yahoo/context-parser","forks_url":"https://api.github.com/repos/yahoo/context-parser/forks","keys_url":"https://api.github.com/repos/yahoo/context-parser/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yahoo/context-parser/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yahoo/context-parser/teams","hooks_url":"https://api.github.com/repos/yahoo/context-parser/hooks","issue_events_url":"https://api.github.com/repos/yahoo/context-parser/issues/events{/number}","events_url":"https://api.github.com/repos/yahoo/context-parser/events","assignees_url":"https://api.github.com/repos/yahoo/context-parser/assignees{/user}","branches_url":"https://api.github.com/repos/yahoo/context-parser/branches{/branch}","tags_url":"https://api.github.com/repos/yahoo/context-parser/tags","blobs_url":"https://api.github.com/repos/yahoo/context-parser/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yahoo/context-parser/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yahoo/context-parser/git/refs{/sha}","trees_url":"https://api.github.com/repos/yahoo/context-parser/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yahoo/context-parser/statuses/{sha}","languages_url":"https://api.github.com/repos/yahoo/context-parser/languages","stargazers_url":"https://api.github.com/repos/yahoo/context-parser/stargazers","contributors_url":"https://api.github.com/repos/yahoo/context-parser/contributors","subscribers_url":"https://api.github.com/repos/yahoo/context-parser/subscribers","subscription_url":"https://api.github.com/repos/yahoo/context-parser/subscription","commits_url":"https://api.github.com/repos/yahoo/context-parser/commits{/sha}","git_commits_url":"https://api.github.com/repos/yahoo/context-parser/git/commits{/sha}","comments_url":"https://api.github.com/repos/yahoo/context-parser/comments{/number}","issue_comment_url":"https://api.github.com/repos/yahoo/context-parser/issues/comments{/number}","contents_url":"https://api.github.com/repos/yahoo/context-parser/contents/{+path}","compare_url":"https://api.github.com/repos/yahoo/context-parser/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yahoo/context-parser/merges","archive_url":"https://api.github.com/repos/yahoo/context-parser/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yahoo/context-parser/downloads","issues_url":"https://api.github.com/repos/yahoo/context-parser/issues{/number}","pulls_url":"https://api.github.com/repos/yahoo/context-parser/pulls{/number}","milestones_url":"https://api.github.com/repos/yahoo/context-parser/milestones{/number}","notifications_url":"https://api.github.com/repos/yahoo/context-parser/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yahoo/context-parser/labels{/name}","releases_url":"https://api.github.com/repos/yahoo/context-parser/releases{/id}","created_at":"2015-02-09T19:35:03Z","updated_at":"2015-06-15T03:09:05Z","pushed_at":"2015-06-15T03:58:32Z","git_url":"git://github.com/yahoo/context-parser.git","ssh_url":"git@github.com:yahoo/context-parser.git","clone_url":"https://github.com/yahoo/context-parser.git","svn_url":"https://github.com/yahoo/context-parser","homepage":"","size":5258,"stargazers_count":15,"watchers_count":15,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":1,"forks":5,"open_issues":1,"watchers":15,"default_branch":"master"}},"base":{"label":"yahoo:master","ref":"master","sha":"a8d8b46344ce61b10d1851f10e262d40b03cab49","user":{"login":"yahoo","id":16574,"avatar_url":"https://avatars.githubusercontent.com/u/16574?v=3","gravatar_id":"","url":"https://api.github.com/users/yahoo","html_url":"https://github.com/yahoo","followers_url":"https://api.github.com/users/yahoo/followers","following_url":"https://api.github.com/users/yahoo/following{/other_user}","gists_url":"https://api.github.com/users/yahoo/gists{/gist_id}","starred_url":"https://api.github.com/users/yahoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yahoo/subscriptions","organizations_url":"https://api.github.com/users/yahoo/orgs","repos_url":"https://api.github.com/users/yahoo/repos","events_url":"https://api.github.com/users/yahoo/events{/privacy}","received_events_url":"https://api.github.com/users/yahoo/received_events","type":"Organization","site_admin":false},"repo":{"id":30554328,"name":"context-parser","full_name":"yahoo/context-parser","owner":{"login":"yahoo","id":16574,"avatar_url":"https://avatars.githubusercontent.com/u/16574?v=3","gravatar_id":"","url":"https://api.github.com/users/yahoo","html_url":"https://github.com/yahoo","followers_url":"https://api.github.com/users/yahoo/followers","following_url":"https://api.github.com/users/yahoo/following{/other_user}","gists_url":"https://api.github.com/users/yahoo/gists{/gist_id}","starred_url":"https://api.github.com/users/yahoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yahoo/subscriptions","organizations_url":"https://api.github.com/users/yahoo/orgs","repos_url":"https://api.github.com/users/yahoo/repos","events_url":"https://api.github.com/users/yahoo/events{/privacy}","received_events_url":"https://api.github.com/users/yahoo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/yahoo/context-parser","description":"HTML5 Context Parser","fork":false,"url":"https://api.github.com/repos/yahoo/context-parser","forks_url":"https://api.github.com/repos/yahoo/context-parser/forks","keys_url":"https://api.github.com/repos/yahoo/context-parser/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yahoo/context-parser/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yahoo/context-parser/teams","hooks_url":"https://api.github.com/repos/yahoo/context-parser/hooks","issue_events_url":"https://api.github.com/repos/yahoo/context-parser/issues/events{/number}","events_url":"https://api.github.com/repos/yahoo/context-parser/events","assignees_url":"https://api.github.com/repos/yahoo/context-parser/assignees{/user}","branches_url":"https://api.github.com/repos/yahoo/context-parser/branches{/branch}","tags_url":"https://api.github.com/repos/yahoo/context-parser/tags","blobs_url":"https://api.github.com/repos/yahoo/context-parser/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yahoo/context-parser/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yahoo/context-parser/git/refs{/sha}","trees_url":"https://api.github.com/repos/yahoo/context-parser/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yahoo/context-parser/statuses/{sha}","languages_url":"https://api.github.com/repos/yahoo/context-parser/languages","stargazers_url":"https://api.github.com/repos/yahoo/context-parser/stargazers","contributors_url":"https://api.github.com/repos/yahoo/context-parser/contributors","subscribers_url":"https://api.github.com/repos/yahoo/context-parser/subscribers","subscription_url":"https://api.github.com/repos/yahoo/context-parser/subscription","commits_url":"https://api.github.com/repos/yahoo/context-parser/commits{/sha}","git_commits_url":"https://api.github.com/repos/yahoo/context-parser/git/commits{/sha}","comments_url":"https://api.github.com/repos/yahoo/context-parser/comments{/number}","issue_comment_url":"https://api.github.com/repos/yahoo/context-parser/issues/comments{/number}","contents_url":"https://api.github.com/repos/yahoo/context-parser/contents/{+path}","compare_url":"https://api.github.com/repos/yahoo/context-parser/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yahoo/context-parser/merges","archive_url":"https://api.github.com/repos/yahoo/context-parser/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yahoo/context-parser/downloads","issues_url":"https://api.github.com/repos/yahoo/context-parser/issues{/number}","pulls_url":"https://api.github.com/repos/yahoo/context-parser/pulls{/number}","milestones_url":"https://api.github.com/repos/yahoo/context-parser/milestones{/number}","notifications_url":"https://api.github.com/repos/yahoo/context-parser/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yahoo/context-parser/labels{/name}","releases_url":"https://api.github.com/repos/yahoo/context-parser/releases{/id}","created_at":"2015-02-09T19:35:03Z","updated_at":"2015-06-15T03:09:05Z","pushed_at":"2015-06-15T03:58:32Z","git_url":"git://github.com/yahoo/context-parser.git","ssh_url":"git@github.com:yahoo/context-parser.git","clone_url":"https://github.com/yahoo/context-parser.git","svn_url":"https://github.com/yahoo/context-parser","homepage":"","size":5258,"stargazers_count":15,"watchers_count":15,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":1,"forks":5,"open_issues":1,"watchers":15,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/yahoo/context-parser/pulls/27"},"html":{"href":"https://github.com/yahoo/context-parser/pull/27"},"issue":{"href":"https://api.github.com/repos/yahoo/context-parser/issues/27"},"comments":{"href":"https://api.github.com/repos/yahoo/context-parser/issues/27/comments"},"review_comments":{"href":"https://api.github.com/repos/yahoo/context-parser/pulls/27/comments"},"review_comment":{"href":"https://api.github.com/repos/yahoo/context-parser/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/yahoo/context-parser/pulls/27/commits"},"statuses":{"href":"https://api.github.com/repos/yahoo/context-parser/statuses/3ecf7a4ca216fa2e611a8f036b0357ea1aabd2a8"}}}}