{"action":"created","comment":{"url":"https://api.github.com/repos/pkp/pkp-lib/pulls/comments/132350822","pull_request_review_id":55421224,"id":132350822,"diff_hunk":"@@ -34,25 +34,80 @@ function CitationListTokenizerFilter() {\n \t * @param $input string\n \t * @return mixed array\n \t */\n-\tfunction &process(&$input) {\n-\t\t// The default implementation assumes that raw citations are\n-\t\t// separated with line endings.\n-\t\t// 1) Remove empty lines and normalize line endings.\n-\t\t$input = String::regexp_replace('/[\\r\\n]+/s', \"\\n\", $input);\n-\t\t// 2) Remove trailing/leading line breaks.\n-\t\t$input = trim($input, \"\\n\");\n-\t\t// 3) Break up at line endings.\n-\t\tif (empty($input)) {\n-\t\t\t$citations = array();\n-\t\t} else {\n-\t\t\t$citations = explode(\"\\n\", $input);\n+        function &process(&$input) {\n+                // The default implementation assumes that raw citations are\n+                // separated with a blank line.\n+\n+                // Normalize line endings.\n+                if (strpos($input, \"\\r\") !== FALSE) {\n+                        // Windows formatting to *nix\n+                        $input = str_replace(\"\\r\\n\", \"\\n\", $input);\n+                        // Are returns begin used as line endings?\n+                        $input = str_replace(\"\\r\", \"\\n\", $input);\n+                }\n+\n+                // Make blank lines truely blank\n+                $lines = explode(\"\\n\", $input);\n+                $input = '';\n+                foreach ($lines as $line) {","path":"classes/citation/CitationListTokenizerFilter.inc.php","position":31,"original_position":31,"commit_id":"e3b012da5bfbcfef739a93606c09b6edf3725725","original_commit_id":"e3b012da5bfbcfef739a93606c09b6edf3725725","user":{"login":"asmecher","id":200411,"avatar_url":"https://avatars0.githubusercontent.com/u/200411?v=4","gravatar_id":"","url":"https://api.github.com/users/asmecher","html_url":"https://github.com/asmecher","followers_url":"https://api.github.com/users/asmecher/followers","following_url":"https://api.github.com/users/asmecher/following{/other_user}","gists_url":"https://api.github.com/users/asmecher/gists{/gist_id}","starred_url":"https://api.github.com/users/asmecher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asmecher/subscriptions","organizations_url":"https://api.github.com/users/asmecher/orgs","repos_url":"https://api.github.com/users/asmecher/repos","events_url":"https://api.github.com/users/asmecher/events{/privacy}","received_events_url":"https://api.github.com/users/asmecher/received_events","type":"User","site_admin":false},"body":"I would think a single multiline regexp would probably replace most of this.","created_at":"2017-08-10T02:22:59Z","updated_at":"2017-08-10T02:22:59Z","html_url":"https://github.com/pkp/pkp-lib/pull/2692#discussion_r132350822","pull_request_url":"https://api.github.com/repos/pkp/pkp-lib/pulls/2692","_links":{"self":{"href":"https://api.github.com/repos/pkp/pkp-lib/pulls/comments/132350822"},"html":{"href":"https://github.com/pkp/pkp-lib/pull/2692#discussion_r132350822"},"pull_request":{"href":"https://api.github.com/repos/pkp/pkp-lib/pulls/2692"}}},"pull_request":{"url":"https://api.github.com/repos/pkp/pkp-lib/pulls/2692","id":134484648,"html_url":"https://github.com/pkp/pkp-lib/pull/2692","diff_url":"https://github.com/pkp/pkp-lib/pull/2692.diff","patch_url":"https://github.com/pkp/pkp-lib/pull/2692.patch","issue_url":"https://api.github.com/repos/pkp/pkp-lib/issues/2692","number":2692,"state":"open","locked":false,"title":"pkp/pkp-lib#2570: Enhance citation tokenizer to support multiline citations separated by a blank line","user":{"login":"ctgraham","id":7001322,"avatar_url":"https://avatars0.githubusercontent.com/u/7001322?v=4","gravatar_id":"","url":"https://api.github.com/users/ctgraham","html_url":"https://github.com/ctgraham","followers_url":"https://api.github.com/users/ctgraham/followers","following_url":"https://api.github.com/users/ctgraham/following{/other_user}","gists_url":"https://api.github.com/users/ctgraham/gists{/gist_id}","starred_url":"https://api.github.com/users/ctgraham/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ctgraham/subscriptions","organizations_url":"https://api.github.com/users/ctgraham/orgs","repos_url":"https://api.github.com/users/ctgraham/repos","events_url":"https://api.github.com/users/ctgraham/events{/privacy}","received_events_url":"https://api.github.com/users/ctgraham/received_events","type":"User","site_admin":false},"body":"Resolves pkp/pkp-lib#2570","created_at":"2017-08-07T17:10:17Z","updated_at":"2017-08-10T02:22:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e33038c940c72a1e3bad583b45a7ec6dafb831af","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":{"url":"https://api.github.com/repos/pkp/pkp-lib/milestones/18","html_url":"https://github.com/pkp/pkp-lib/milestone/18","labels_url":"https://api.github.com/repos/pkp/pkp-lib/milestones/18/labels","id":1503460,"number":18,"title":"OJS 2.4.9","description":"","creator":{"login":"asmecher","id":200411,"avatar_url":"https://avatars0.githubusercontent.com/u/200411?v=4","gravatar_id":"","url":"https://api.github.com/users/asmecher","html_url":"https://github.com/asmecher","followers_url":"https://api.github.com/users/asmecher/followers","following_url":"https://api.github.com/users/asmecher/following{/other_user}","gists_url":"https://api.github.com/users/asmecher/gists{/gist_id}","starred_url":"https://api.github.com/users/asmecher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asmecher/subscriptions","organizations_url":"https://api.github.com/users/asmecher/orgs","repos_url":"https://api.github.com/users/asmecher/repos","events_url":"https://api.github.com/users/asmecher/events{/privacy}","received_events_url":"https://api.github.com/users/asmecher/received_events","type":"User","site_admin":false},"open_issues":42,"closed_issues":39,"state":"open","created_at":"2016-01-12T23:57:39Z","updated_at":"2017-08-07T17:10:22Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/pkp/pkp-lib/pulls/2692/commits","review_comments_url":"https://api.github.com/repos/pkp/pkp-lib/pulls/2692/comments","review_comment_url":"https://api.github.com/repos/pkp/pkp-lib/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pkp/pkp-lib/issues/2692/comments","statuses_url":"https://api.github.com/repos/pkp/pkp-lib/statuses/e3b012da5bfbcfef739a93606c09b6edf3725725","head":{"label":"ulsdevteam:multiline-citation-tokenizer","ref":"multiline-citation-tokenizer","sha":"e3b012da5bfbcfef739a93606c09b6edf3725725","user":{"login":"ulsdevteam","id":2464639,"avatar_url":"https://avatars1.githubusercontent.com/u/2464639?v=4","gravatar_id":"","url":"https://api.github.com/users/ulsdevteam","html_url":"https://github.com/ulsdevteam","followers_url":"https://api.github.com/users/ulsdevteam/followers","following_url":"https://api.github.com/users/ulsdevteam/following{/other_user}","gists_url":"https://api.github.com/users/ulsdevteam/gists{/gist_id}","starred_url":"https://api.github.com/users/ulsdevteam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ulsdevteam/subscriptions","organizations_url":"https://api.github.com/users/ulsdevteam/orgs","repos_url":"https://api.github.com/users/ulsdevteam/repos","events_url":"https://api.github.com/users/ulsdevteam/events{/privacy}","received_events_url":"https://api.github.com/users/ulsdevteam/received_events","type":"Organization","site_admin":false},"repo":{"id":6062099,"name":"pkp-lib","full_name":"ulsdevteam/pkp-lib","owner":{"login":"ulsdevteam","id":2464639,"avatar_url":"https://avatars1.githubusercontent.com/u/2464639?v=4","gravatar_id":"","url":"https://api.github.com/users/ulsdevteam","html_url":"https://github.com/ulsdevteam","followers_url":"https://api.github.com/users/ulsdevteam/followers","following_url":"https://api.github.com/users/ulsdevteam/following{/other_user}","gists_url":"https://api.github.com/users/ulsdevteam/gists{/gist_id}","starred_url":"https://api.github.com/users/ulsdevteam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ulsdevteam/subscriptions","organizations_url":"https://api.github.com/users/ulsdevteam/orgs","repos_url":"https://api.github.com/users/ulsdevteam/repos","events_url":"https://api.github.com/users/ulsdevteam/events{/privacy}","received_events_url":"https://api.github.com/users/ulsdevteam/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ulsdevteam/pkp-lib","description":"PKP Web Application Library","fork":true,"url":"https://api.github.com/repos/ulsdevteam/pkp-lib","forks_url":"https://api.github.com/repos/ulsdevteam/pkp-lib/forks","keys_url":"https://api.github.com/repos/ulsdevteam/pkp-lib/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ulsdevteam/pkp-lib/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ulsdevteam/pkp-lib/teams","hooks_url":"https://api.github.com/repos/ulsdevteam/pkp-lib/hooks","issue_events_url":"https://api.github.com/repos/ulsdevteam/pkp-lib/issues/events{/number}","events_url":"https://api.github.com/repos/ulsdevteam/pkp-lib/events","assignees_url":"https://api.github.com/repos/ulsdevteam/pkp-lib/assignees{/user}","branches_url":"https://api.github.com/repos/ulsdevteam/pkp-lib/branches{/branch}","tags_url":"https://api.github.com/repos/ulsdevteam/pkp-lib/tags","blobs_url":"https://api.github.com/repos/ulsdevteam/pkp-lib/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ulsdevteam/pkp-lib/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ulsdevteam/pkp-lib/git/refs{/sha}","trees_url":"https://api.github.com/repos/ulsdevteam/pkp-lib/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ulsdevteam/pkp-lib/statuses/{sha}","languages_url":"https://api.github.com/repos/ulsdevteam/pkp-lib/languages","stargazers_url":"https://api.github.com/repos/ulsdevteam/pkp-lib/stargazers","contributors_url":"https://api.github.com/repos/ulsdevteam/pkp-lib/contributors","subscribers_url":"https://api.github.com/repos/ulsdevteam/pkp-lib/subscribers","subscription_url":"https://api.github.com/repos/ulsdevteam/pkp-lib/subscription","commits_url":"https://api.github.com/repos/ulsdevteam/pkp-lib/commits{/sha}","git_commits_url":"https://api.github.com/repos/ulsdevteam/pkp-lib/git/commits{/sha}","comments_url":"https://api.github.com/repos/ulsdevteam/pkp-lib/comments{/number}","issue_comment_url":"https://api.github.com/repos/ulsdevteam/pkp-lib/issues/comments{/number}","contents_url":"https://api.github.com/repos/ulsdevteam/pkp-lib/contents/{+path}","compare_url":"https://api.github.com/repos/ulsdevteam/pkp-lib/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ulsdevteam/pkp-lib/merges","archive_url":"https://api.github.com/repos/ulsdevteam/pkp-lib/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ulsdevteam/pkp-lib/downloads","issues_url":"https://api.github.com/repos/ulsdevteam/pkp-lib/issues{/number}","pulls_url":"https://api.github.com/repos/ulsdevteam/pkp-lib/pulls{/number}","milestones_url":"https://api.github.com/repos/ulsdevteam/pkp-lib/milestones{/number}","notifications_url":"https://api.github.com/repos/ulsdevteam/pkp-lib/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ulsdevteam/pkp-lib/labels{/name}","releases_url":"https://api.github.com/repos/ulsdevteam/pkp-lib/releases{/id}","deployments_url":"https://api.github.com/repos/ulsdevteam/pkp-lib/deployments","created_at":"2012-10-03T15:24:55Z","updated_at":"2015-03-06T15:58:06Z","pushed_at":"2017-08-03T19:19:15Z","git_url":"git://github.com/ulsdevteam/pkp-lib.git","ssh_url":"git@github.com:ulsdevteam/pkp-lib.git","clone_url":"https://github.com/ulsdevteam/pkp-lib.git","svn_url":"https://github.com/ulsdevteam/pkp-lib","homepage":"http://pkp.sfu.ca","size":57821,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"uls-install"}},"base":{"label":"pkp:ojs-dev-2_4","ref":"ojs-dev-2_4","sha":"f41aa4b8cfd698a915cc2fc81b4df87813543784","user":{"login":"pkp","id":130896,"avatar_url":"https://avatars3.githubusercontent.com/u/130896?v=4","gravatar_id":"","url":"https://api.github.com/users/pkp","html_url":"https://github.com/pkp","followers_url":"https://api.github.com/users/pkp/followers","following_url":"https://api.github.com/users/pkp/following{/other_user}","gists_url":"https://api.github.com/users/pkp/gists{/gist_id}","starred_url":"https://api.github.com/users/pkp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pkp/subscriptions","organizations_url":"https://api.github.com/users/pkp/orgs","repos_url":"https://api.github.com/users/pkp/repos","events_url":"https://api.github.com/users/pkp/events{/privacy}","received_events_url":"https://api.github.com/users/pkp/received_events","type":"Organization","site_admin":false},"repo":{"id":316712,"name":"pkp-lib","full_name":"pkp/pkp-lib","owner":{"login":"pkp","id":130896,"avatar_url":"https://avatars3.githubusercontent.com/u/130896?v=4","gravatar_id":"","url":"https://api.github.com/users/pkp","html_url":"https://github.com/pkp","followers_url":"https://api.github.com/users/pkp/followers","following_url":"https://api.github.com/users/pkp/following{/other_user}","gists_url":"https://api.github.com/users/pkp/gists{/gist_id}","starred_url":"https://api.github.com/users/pkp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pkp/subscriptions","organizations_url":"https://api.github.com/users/pkp/orgs","repos_url":"https://api.github.com/users/pkp/repos","events_url":"https://api.github.com/users/pkp/events{/privacy}","received_events_url":"https://api.github.com/users/pkp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pkp/pkp-lib","description":"PKP Web Application Library","fork":false,"url":"https://api.github.com/repos/pkp/pkp-lib","forks_url":"https://api.github.com/repos/pkp/pkp-lib/forks","keys_url":"https://api.github.com/repos/pkp/pkp-lib/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pkp/pkp-lib/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pkp/pkp-lib/teams","hooks_url":"https://api.github.com/repos/pkp/pkp-lib/hooks","issue_events_url":"https://api.github.com/repos/pkp/pkp-lib/issues/events{/number}","events_url":"https://api.github.com/repos/pkp/pkp-lib/events","assignees_url":"https://api.github.com/repos/pkp/pkp-lib/assignees{/user}","branches_url":"https://api.github.com/repos/pkp/pkp-lib/branches{/branch}","tags_url":"https://api.github.com/repos/pkp/pkp-lib/tags","blobs_url":"https://api.github.com/repos/pkp/pkp-lib/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pkp/pkp-lib/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pkp/pkp-lib/git/refs{/sha}","trees_url":"https://api.github.com/repos/pkp/pkp-lib/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pkp/pkp-lib/statuses/{sha}","languages_url":"https://api.github.com/repos/pkp/pkp-lib/languages","stargazers_url":"https://api.github.com/repos/pkp/pkp-lib/stargazers","contributors_url":"https://api.github.com/repos/pkp/pkp-lib/contributors","subscribers_url":"https://api.github.com/repos/pkp/pkp-lib/subscribers","subscription_url":"https://api.github.com/repos/pkp/pkp-lib/subscription","commits_url":"https://api.github.com/repos/pkp/pkp-lib/commits{/sha}","git_commits_url":"https://api.github.com/repos/pkp/pkp-lib/git/commits{/sha}","comments_url":"https://api.github.com/repos/pkp/pkp-lib/comments{/number}","issue_comment_url":"https://api.github.com/repos/pkp/pkp-lib/issues/comments{/number}","contents_url":"https://api.github.com/repos/pkp/pkp-lib/contents/{+path}","compare_url":"https://api.github.com/repos/pkp/pkp-lib/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pkp/pkp-lib/merges","archive_url":"https://api.github.com/repos/pkp/pkp-lib/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pkp/pkp-lib/downloads","issues_url":"https://api.github.com/repos/pkp/pkp-lib/issues{/number}","pulls_url":"https://api.github.com/repos/pkp/pkp-lib/pulls{/number}","milestones_url":"https://api.github.com/repos/pkp/pkp-lib/milestones{/number}","notifications_url":"https://api.github.com/repos/pkp/pkp-lib/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pkp/pkp-lib/labels{/name}","releases_url":"https://api.github.com/repos/pkp/pkp-lib/releases{/id}","deployments_url":"https://api.github.com/repos/pkp/pkp-lib/deployments","created_at":"2009-09-24T19:30:31Z","updated_at":"2017-07-31T11:47:04Z","pushed_at":"2017-08-09T21:05:12Z","git_url":"git://github.com/pkp/pkp-lib.git","ssh_url":"git@github.com:pkp/pkp-lib.git","clone_url":"https://github.com/pkp/pkp-lib.git","svn_url":"https://github.com/pkp/pkp-lib","homepage":"http://pkp.sfu.ca","size":61016,"stargazers_count":95,"watchers_count":95,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":216,"mirror_url":null,"open_issues_count":397,"forks":216,"open_issues":397,"watchers":95,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pkp/pkp-lib/pulls/2692"},"html":{"href":"https://github.com/pkp/pkp-lib/pull/2692"},"issue":{"href":"https://api.github.com/repos/pkp/pkp-lib/issues/2692"},"comments":{"href":"https://api.github.com/repos/pkp/pkp-lib/issues/2692/comments"},"review_comments":{"href":"https://api.github.com/repos/pkp/pkp-lib/pulls/2692/comments"},"review_comment":{"href":"https://api.github.com/repos/pkp/pkp-lib/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pkp/pkp-lib/pulls/2692/commits"},"statuses":{"href":"https://api.github.com/repos/pkp/pkp-lib/statuses/e3b012da5bfbcfef739a93606c09b6edf3725725"}}}}
{"actor":{"display_login":"asmecher"}}