{"action":"created","comment":{"url":"https://api.github.com/repos/nichtich/Pandoc-Elements/pulls/comments/87162099","pull_request_review_id":7784153,"id":87162099,"diff_hunk":"@@ -3,11 +3,31 @@ use strict;\n use warnings;\n use 5.010;\n \n+use utf8; # because of non-breaking spaces in line blocks\n+\n our $VERSION = '0.25';\n \n-our $PANDOC_VERSION;    # a string like '1.16'\n+use vars (    # let them have file scope\n+    '$PANDOC_VERSION',           # a string like '1.16'\n+    '$PANDOC_API_VERSION',       # a string like '1.17.0.4'\n+    '%PANDOC_API_VERSION_OF',    # maps pandoc versions to api versions\n+);\n+\n $PANDOC_VERSION ||= $ENV{PANDOC_VERSION};\n \n+# This must be updated for each pandoc version >= 1.18\n+%PANDOC_API_VERSION_OF = (\n+    ## Shall give undef for pandoc < 1.18!\n+    '1.18' => '1.17.0.4',\n+);\n+","path":"lib/Pandoc/Elements.pm","position":22,"original_position":22,"commit_id":"9f06e3587a561e4b059f7df39a30c6b03bcd6f65","original_commit_id":"23929c73fcbe34389be2b553a3e3be8e517023ab","user":{"login":"bpj","id":1161043,"avatar_url":"https://avatars.githubusercontent.com/u/1161043?v=3","gravatar_id":"","url":"https://api.github.com/users/bpj","html_url":"https://github.com/bpj","followers_url":"https://api.github.com/users/bpj/followers","following_url":"https://api.github.com/users/bpj/following{/other_user}","gists_url":"https://api.github.com/users/bpj/gists{/gist_id}","starred_url":"https://api.github.com/users/bpj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bpj/subscriptions","organizations_url":"https://api.github.com/users/bpj/orgs","repos_url":"https://api.github.com/users/bpj/repos","events_url":"https://api.github.com/users/bpj/events{/privacy}","received_events_url":"https://api.github.com/users/bpj/received_events","type":"User","site_admin":false},"body":"I think `PANDOC_API_VERSION` and `[pandoc-]api-version` will be safer, because that's what the JSON field, and that's what people are most likely to see. Also I don't think we'll need to list pandoc-version => api-version mappings for pandoc versions before 1.18. Their 'api version' should be 'zero' by design, since the field isn't present in their JSON format. That way if someone checks the `api_version` method they will immediately see that they are dealing with a version which expects the old JSON format.","created_at":"2016-11-09T10:01:07Z","updated_at":"2016-11-09T10:01:07Z","html_url":"https://github.com/nichtich/Pandoc-Elements/pull/51#discussion_r87162099","pull_request_url":"https://api.github.com/repos/nichtich/Pandoc-Elements/pulls/51","_links":{"self":{"href":"https://api.github.com/repos/nichtich/Pandoc-Elements/pulls/comments/87162099"},"html":{"href":"https://github.com/nichtich/Pandoc-Elements/pull/51#discussion_r87162099"},"pull_request":{"href":"https://api.github.com/repos/nichtich/Pandoc-Elements/pulls/51"}}},"pull_request":{"url":"https://api.github.com/repos/nichtich/Pandoc-Elements/pulls/51","id":91594822,"html_url":"https://github.com/nichtich/Pandoc-Elements/pull/51","diff_url":"https://github.com/nichtich/Pandoc-Elements/pull/51.diff","patch_url":"https://github.com/nichtich/Pandoc-Elements/pull/51.patch","issue_url":"https://api.github.com/repos/nichtich/Pandoc-Elements/issues/51","number":51,"state":"open","locked":false,"title":"updates for pandoc 1.18 - no documentation yet","user":{"login":"bpj","id":1161043,"avatar_url":"https://avatars.githubusercontent.com/u/1161043?v=3","gravatar_id":"","url":"https://api.github.com/users/bpj","html_url":"https://github.com/bpj","followers_url":"https://api.github.com/users/bpj/followers","following_url":"https://api.github.com/users/bpj/following{/other_user}","gists_url":"https://api.github.com/users/bpj/gists{/gist_id}","starred_url":"https://api.github.com/users/bpj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bpj/subscriptions","organizations_url":"https://api.github.com/users/bpj/orgs","repos_url":"https://api.github.com/users/bpj/repos","events_url":"https://api.github.com/users/bpj/events{/privacy}","received_events_url":"https://api.github.com/users/bpj/received_events","type":"User","site_admin":false},"body":"*   Accommodated for the new JSON style in a backwards-compatible way.\r\n\r\n*   Added new LineBlock element with api-version sensitive TO_JSON()\r\n\r\n    ```perl\r\n    LineBlock [ @lines ]    # each line an arrayref of inlines\r\n    ```\r\n\r\n    Leading space characters (U+0020) on each line are converted to\r\n    non-breaking spaces (U+00A0) when emitting JSON as Pandoc does.\r\n\r\n*   Added various things to accomodate/use the new `pandoc-api-version` flag in the AST.\r\n\r\n    The `pandoc-api-version` value in the Document object is an object with\r\n    ~~overloaded stringification and numification~~ comparison methods.  That's a bit radical but\r\n    allows for human-readable inspection and ~~use of perl's comparison operators~~ version comparison,\r\n    which I think is essential.\r\n\r\n    New functions `pandoc_api_version()` and `pandoc_api_version_of()`.\r\n    Both return objects as per the preceding paragraph.\r\n    `pandoc_api_version()` takes either a string representation like\r\n    `'1.17.0.4'` or an arrayref like `[1,17,0,4]` as pandoc emits.\r\n    `pandoc_api_version_of()` takes a pandoc executable version number\r\n    as a string like `'1.18'`. The idea is that since the API version number\r\n    is different from the executable version number and kind of hard to\r\n    come by the module keeps a mapping from executable versions to API versions.\r\n\r\n    The `Document` constructor now accepts any of the following argument styles:\r\n\r\n    ```perl\r\n    # old-style still works, implies empty API version\r\n    Document { %meta }, [ @blocks ];               \r\n\r\n    # easy upgrade\r\n    Document { %meta }, [ @blocks ], $api_version; \r\n\r\n    # future-proof easy upgrade\r\n    Document { %meta }, [ @blocks ], api_version => $api_version;\r\n\r\n    # even easier upgrade\r\n    Document { %meta }, [ @blocks ], api_version_of => $executable_version;\r\n\r\n    # old-style data structure, implies empty API version\r\n    Document [ {unMeta => \\%meta}, [ @blocks ] ]\r\n\r\n    # new-style data structure and/or hash with parameters\r\n    Document {\r\n        meta   => { %meta },        # defaults to empty hash\r\n        blocks => [ @blocks ],      # defaults to empty array\r\n        # these are all supported;\r\n        # listed in order of preference;\r\n        # defaults to $Pandoc::Elements::PANDOC_API_VERSION\r\n        # if defined, else to undef = empty object\r\n        'pandoc-api-version' => $api_version,        # e.g. '1.17.0.4'\r\n        pandoc_api_version   => $api_version,\r\n        api_version          => $api_version,\r\n        api_version_of       => $executable_version, # e.g. '1.18'\r\n    }\r\n    ```\r\n\r\n*   Added `Pandoc::Document::TO_JSON()` which localizes \r\n    `$Pandoc::Elements::PANDOC_API_VERSION` to the version\r\n    stored in the Document, then calls the catchall `TO_JSON()`\r\n    The latter now calls `TO_JSON()` if any on nested objects,\r\n    so that the localized variable value propagates down the tree.\r\n    Currently used by `Pandoc::Document::LineBlock::TO_JSON()`.\r\n\r\n*   Added/tweaked tests which all pass (hopefully sensibly).\r\n\r\n*   No documentation yet but lots of comments.\r\n\r\nI did not do anything to distinguish between empty elements\r\nlike LineBreak with or without a dummy content array,\r\nsince [jgm says it's not necessary][pandocfilters]\r\nand hasn't done so for jgm/pandocfilters.\r\nWe probably should add tests to make sure it really works. Will do.\r\n\r\n[pandocfilters]: https://github.com/jgm/pandocfilters/commit/039dcc65bc10a14f9038a3671c795198bd50c15a#commitcomment-19579664\r\n\r\n[1.18-commit.pod.zip](https://github.com/nichtich/Pandoc-Elements/files/561622/1.18-commit.pod.zip)\r\n","created_at":"2016-10-31T11:39:22Z","updated_at":"2016-11-09T10:01:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b4bb0aea0e1743c52fba8b957e1144c22b894e22","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/nichtich/Pandoc-Elements/pulls/51/commits","review_comments_url":"https://api.github.com/repos/nichtich/Pandoc-Elements/pulls/51/comments","review_comment_url":"https://api.github.com/repos/nichtich/Pandoc-Elements/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nichtich/Pandoc-Elements/issues/51/comments","statuses_url":"https://api.github.com/repos/nichtich/Pandoc-Elements/statuses/9f06e3587a561e4b059f7df39a30c6b03bcd6f65","head":{"label":"bpj:bpj-pandoc-1.18","ref":"bpj-pandoc-1.18","sha":"9f06e3587a561e4b059f7df39a30c6b03bcd6f65","user":{"login":"bpj","id":1161043,"avatar_url":"https://avatars.githubusercontent.com/u/1161043?v=3","gravatar_id":"","url":"https://api.github.com/users/bpj","html_url":"https://github.com/bpj","followers_url":"https://api.github.com/users/bpj/followers","following_url":"https://api.github.com/users/bpj/following{/other_user}","gists_url":"https://api.github.com/users/bpj/gists{/gist_id}","starred_url":"https://api.github.com/users/bpj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bpj/subscriptions","organizations_url":"https://api.github.com/users/bpj/orgs","repos_url":"https://api.github.com/users/bpj/repos","events_url":"https://api.github.com/users/bpj/events{/privacy}","received_events_url":"https://api.github.com/users/bpj/received_events","type":"User","site_admin":false},"repo":{"id":51516162,"name":"Pandoc-Elements","full_name":"bpj/Pandoc-Elements","owner":{"login":"bpj","id":1161043,"avatar_url":"https://avatars.githubusercontent.com/u/1161043?v=3","gravatar_id":"","url":"https://api.github.com/users/bpj","html_url":"https://github.com/bpj","followers_url":"https://api.github.com/users/bpj/followers","following_url":"https://api.github.com/users/bpj/following{/other_user}","gists_url":"https://api.github.com/users/bpj/gists{/gist_id}","starred_url":"https://api.github.com/users/bpj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bpj/subscriptions","organizations_url":"https://api.github.com/users/bpj/orgs","repos_url":"https://api.github.com/users/bpj/repos","events_url":"https://api.github.com/users/bpj/events{/privacy}","received_events_url":"https://api.github.com/users/bpj/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bpj/Pandoc-Elements","description":"Perl module to create and process Pandoc documents","fork":true,"url":"https://api.github.com/repos/bpj/Pandoc-Elements","forks_url":"https://api.github.com/repos/bpj/Pandoc-Elements/forks","keys_url":"https://api.github.com/repos/bpj/Pandoc-Elements/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bpj/Pandoc-Elements/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bpj/Pandoc-Elements/teams","hooks_url":"https://api.github.com/repos/bpj/Pandoc-Elements/hooks","issue_events_url":"https://api.github.com/repos/bpj/Pandoc-Elements/issues/events{/number}","events_url":"https://api.github.com/repos/bpj/Pandoc-Elements/events","assignees_url":"https://api.github.com/repos/bpj/Pandoc-Elements/assignees{/user}","branches_url":"https://api.github.com/repos/bpj/Pandoc-Elements/branches{/branch}","tags_url":"https://api.github.com/repos/bpj/Pandoc-Elements/tags","blobs_url":"https://api.github.com/repos/bpj/Pandoc-Elements/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bpj/Pandoc-Elements/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bpj/Pandoc-Elements/git/refs{/sha}","trees_url":"https://api.github.com/repos/bpj/Pandoc-Elements/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bpj/Pandoc-Elements/statuses/{sha}","languages_url":"https://api.github.com/repos/bpj/Pandoc-Elements/languages","stargazers_url":"https://api.github.com/repos/bpj/Pandoc-Elements/stargazers","contributors_url":"https://api.github.com/repos/bpj/Pandoc-Elements/contributors","subscribers_url":"https://api.github.com/repos/bpj/Pandoc-Elements/subscribers","subscription_url":"https://api.github.com/repos/bpj/Pandoc-Elements/subscription","commits_url":"https://api.github.com/repos/bpj/Pandoc-Elements/commits{/sha}","git_commits_url":"https://api.github.com/repos/bpj/Pandoc-Elements/git/commits{/sha}","comments_url":"https://api.github.com/repos/bpj/Pandoc-Elements/comments{/number}","issue_comment_url":"https://api.github.com/repos/bpj/Pandoc-Elements/issues/comments{/number}","contents_url":"https://api.github.com/repos/bpj/Pandoc-Elements/contents/{+path}","compare_url":"https://api.github.com/repos/bpj/Pandoc-Elements/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bpj/Pandoc-Elements/merges","archive_url":"https://api.github.com/repos/bpj/Pandoc-Elements/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bpj/Pandoc-Elements/downloads","issues_url":"https://api.github.com/repos/bpj/Pandoc-Elements/issues{/number}","pulls_url":"https://api.github.com/repos/bpj/Pandoc-Elements/pulls{/number}","milestones_url":"https://api.github.com/repos/bpj/Pandoc-Elements/milestones{/number}","notifications_url":"https://api.github.com/repos/bpj/Pandoc-Elements/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bpj/Pandoc-Elements/labels{/name}","releases_url":"https://api.github.com/repos/bpj/Pandoc-Elements/releases{/id}","deployments_url":"https://api.github.com/repos/bpj/Pandoc-Elements/deployments","created_at":"2016-02-11T13:24:21Z","updated_at":"2016-02-11T13:24:22Z","pushed_at":"2016-11-03T18:28:41Z","git_url":"git://github.com/bpj/Pandoc-Elements.git","ssh_url":"git@github.com:bpj/Pandoc-Elements.git","clone_url":"https://github.com/bpj/Pandoc-Elements.git","svn_url":"https://github.com/bpj/Pandoc-Elements","homepage":"https://metacpan.org/release/Pandoc-Elements","size":237,"stargazers_count":0,"watchers_count":0,"language":"Perl","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"nichtich:master","ref":"master","sha":"2364fddd8c7e6465d06d2f6b5c597385f9d047ae","user":{"login":"nichtich","id":299856,"avatar_url":"https://avatars.githubusercontent.com/u/299856?v=3","gravatar_id":"","url":"https://api.github.com/users/nichtich","html_url":"https://github.com/nichtich","followers_url":"https://api.github.com/users/nichtich/followers","following_url":"https://api.github.com/users/nichtich/following{/other_user}","gists_url":"https://api.github.com/users/nichtich/gists{/gist_id}","starred_url":"https://api.github.com/users/nichtich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nichtich/subscriptions","organizations_url":"https://api.github.com/users/nichtich/orgs","repos_url":"https://api.github.com/users/nichtich/repos","events_url":"https://api.github.com/users/nichtich/events{/privacy}","received_events_url":"https://api.github.com/users/nichtich/received_events","type":"User","site_admin":false},"repo":{"id":25653961,"name":"Pandoc-Elements","full_name":"nichtich/Pandoc-Elements","owner":{"login":"nichtich","id":299856,"avatar_url":"https://avatars.githubusercontent.com/u/299856?v=3","gravatar_id":"","url":"https://api.github.com/users/nichtich","html_url":"https://github.com/nichtich","followers_url":"https://api.github.com/users/nichtich/followers","following_url":"https://api.github.com/users/nichtich/following{/other_user}","gists_url":"https://api.github.com/users/nichtich/gists{/gist_id}","starred_url":"https://api.github.com/users/nichtich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nichtich/subscriptions","organizations_url":"https://api.github.com/users/nichtich/orgs","repos_url":"https://api.github.com/users/nichtich/repos","events_url":"https://api.github.com/users/nichtich/events{/privacy}","received_events_url":"https://api.github.com/users/nichtich/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nichtich/Pandoc-Elements","description":"Perl module to create and process Pandoc documents","fork":false,"url":"https://api.github.com/repos/nichtich/Pandoc-Elements","forks_url":"https://api.github.com/repos/nichtich/Pandoc-Elements/forks","keys_url":"https://api.github.com/repos/nichtich/Pandoc-Elements/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nichtich/Pandoc-Elements/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nichtich/Pandoc-Elements/teams","hooks_url":"https://api.github.com/repos/nichtich/Pandoc-Elements/hooks","issue_events_url":"https://api.github.com/repos/nichtich/Pandoc-Elements/issues/events{/number}","events_url":"https://api.github.com/repos/nichtich/Pandoc-Elements/events","assignees_url":"https://api.github.com/repos/nichtich/Pandoc-Elements/assignees{/user}","branches_url":"https://api.github.com/repos/nichtich/Pandoc-Elements/branches{/branch}","tags_url":"https://api.github.com/repos/nichtich/Pandoc-Elements/tags","blobs_url":"https://api.github.com/repos/nichtich/Pandoc-Elements/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nichtich/Pandoc-Elements/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nichtich/Pandoc-Elements/git/refs{/sha}","trees_url":"https://api.github.com/repos/nichtich/Pandoc-Elements/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nichtich/Pandoc-Elements/statuses/{sha}","languages_url":"https://api.github.com/repos/nichtich/Pandoc-Elements/languages","stargazers_url":"https://api.github.com/repos/nichtich/Pandoc-Elements/stargazers","contributors_url":"https://api.github.com/repos/nichtich/Pandoc-Elements/contributors","subscribers_url":"https://api.github.com/repos/nichtich/Pandoc-Elements/subscribers","subscription_url":"https://api.github.com/repos/nichtich/Pandoc-Elements/subscription","commits_url":"https://api.github.com/repos/nichtich/Pandoc-Elements/commits{/sha}","git_commits_url":"https://api.github.com/repos/nichtich/Pandoc-Elements/git/commits{/sha}","comments_url":"https://api.github.com/repos/nichtich/Pandoc-Elements/comments{/number}","issue_comment_url":"https://api.github.com/repos/nichtich/Pandoc-Elements/issues/comments{/number}","contents_url":"https://api.github.com/repos/nichtich/Pandoc-Elements/contents/{+path}","compare_url":"https://api.github.com/repos/nichtich/Pandoc-Elements/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nichtich/Pandoc-Elements/merges","archive_url":"https://api.github.com/repos/nichtich/Pandoc-Elements/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nichtich/Pandoc-Elements/downloads","issues_url":"https://api.github.com/repos/nichtich/Pandoc-Elements/issues{/number}","pulls_url":"https://api.github.com/repos/nichtich/Pandoc-Elements/pulls{/number}","milestones_url":"https://api.github.com/repos/nichtich/Pandoc-Elements/milestones{/number}","notifications_url":"https://api.github.com/repos/nichtich/Pandoc-Elements/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nichtich/Pandoc-Elements/labels{/name}","releases_url":"https://api.github.com/repos/nichtich/Pandoc-Elements/releases{/id}","deployments_url":"https://api.github.com/repos/nichtich/Pandoc-Elements/deployments","created_at":"2014-10-23T19:23:09Z","updated_at":"2016-11-03T19:04:38Z","pushed_at":"2016-11-03T19:04:37Z","git_url":"git://github.com/nichtich/Pandoc-Elements.git","ssh_url":"git@github.com:nichtich/Pandoc-Elements.git","clone_url":"https://github.com/nichtich/Pandoc-Elements.git","svn_url":"https://github.com/nichtich/Pandoc-Elements","homepage":"https://metacpan.org/release/Pandoc-Elements","size":254,"stargazers_count":2,"watchers_count":2,"language":"Perl","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":21,"forks":1,"open_issues":21,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/nichtich/Pandoc-Elements/pulls/51"},"html":{"href":"https://github.com/nichtich/Pandoc-Elements/pull/51"},"issue":{"href":"https://api.github.com/repos/nichtich/Pandoc-Elements/issues/51"},"comments":{"href":"https://api.github.com/repos/nichtich/Pandoc-Elements/issues/51/comments"},"review_comments":{"href":"https://api.github.com/repos/nichtich/Pandoc-Elements/pulls/51/comments"},"review_comment":{"href":"https://api.github.com/repos/nichtich/Pandoc-Elements/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nichtich/Pandoc-Elements/pulls/51/commits"},"statuses":{"href":"https://api.github.com/repos/nichtich/Pandoc-Elements/statuses/9f06e3587a561e4b059f7df39a30c6b03bcd6f65"}}}}
{"actor":{"display_login":"bpj"}}