{"action":"created","issue":{"url":"https://api.github.com/repos/asciidoctor/asciidoctor/issues/2455","repository_url":"https://api.github.com/repos/asciidoctor/asciidoctor","labels_url":"https://api.github.com/repos/asciidoctor/asciidoctor/issues/2455/labels{/name}","comments_url":"https://api.github.com/repos/asciidoctor/asciidoctor/issues/2455/comments","events_url":"https://api.github.com/repos/asciidoctor/asciidoctor/issues/2455/events","html_url":"https://github.com/asciidoctor/asciidoctor/issues/2455","id":265596205,"number":2455,"title":"Remove the special case for 'xmlhttprequest' in the include processor","user":{"login":"Mogztter","id":333276,"avatar_url":"https://avatars3.githubusercontent.com/u/333276?v=4","gravatar_id":"","url":"https://api.github.com/users/Mogztter","html_url":"https://github.com/Mogztter","followers_url":"https://api.github.com/users/Mogztter/followers","following_url":"https://api.github.com/users/Mogztter/following{/other_user}","gists_url":"https://api.github.com/users/Mogztter/gists{/gist_id}","starred_url":"https://api.github.com/users/Mogztter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mogztter/subscriptions","organizations_url":"https://api.github.com/users/Mogztter/orgs","repos_url":"https://api.github.com/users/Mogztter/repos","events_url":"https://api.github.com/users/Mogztter/events{/privacy}","received_events_url":"https://api.github.com/users/Mogztter/received_events","type":"User","site_admin":false},"labels":[{"id":26723930,"url":"https://api.github.com/repos/asciidoctor/asciidoctor/labels/compliance","name":"compliance","color":"0b02e1","default":false},{"id":53804675,"url":"https://api.github.com/repos/asciidoctor/asciidoctor/labels/improvement","name":"improvement","color":"eb6420","default":false}],"state":"open","locked":false,"assignee":{"login":"mojavelinux","id":79351,"avatar_url":"https://avatars2.githubusercontent.com/u/79351?v=4","gravatar_id":"","url":"https://api.github.com/users/mojavelinux","html_url":"https://github.com/mojavelinux","followers_url":"https://api.github.com/users/mojavelinux/followers","following_url":"https://api.github.com/users/mojavelinux/following{/other_user}","gists_url":"https://api.github.com/users/mojavelinux/gists{/gist_id}","starred_url":"https://api.github.com/users/mojavelinux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mojavelinux/subscriptions","organizations_url":"https://api.github.com/users/mojavelinux/orgs","repos_url":"https://api.github.com/users/mojavelinux/repos","events_url":"https://api.github.com/users/mojavelinux/events{/privacy}","received_events_url":"https://api.github.com/users/mojavelinux/received_events","type":"User","site_admin":false},"assignees":[{"login":"mojavelinux","id":79351,"avatar_url":"https://avatars2.githubusercontent.com/u/79351?v=4","gravatar_id":"","url":"https://api.github.com/users/mojavelinux","html_url":"https://github.com/mojavelinux","followers_url":"https://api.github.com/users/mojavelinux/followers","following_url":"https://api.github.com/users/mojavelinux/following{/other_user}","gists_url":"https://api.github.com/users/mojavelinux/gists{/gist_id}","starred_url":"https://api.github.com/users/mojavelinux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mojavelinux/subscriptions","organizations_url":"https://api.github.com/users/mojavelinux/orgs","repos_url":"https://api.github.com/users/mojavelinux/repos","events_url":"https://api.github.com/users/mojavelinux/events{/privacy}","received_events_url":"https://api.github.com/users/mojavelinux/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/asciidoctor/asciidoctor/milestones/22","html_url":"https://github.com/asciidoctor/asciidoctor/milestone/22","labels_url":"https://api.github.com/repos/asciidoctor/asciidoctor/milestones/22/labels","id":2409315,"number":22,"title":"v1.5.7","description":"","creator":{"login":"mojavelinux","id":79351,"avatar_url":"https://avatars2.githubusercontent.com/u/79351?v=4","gravatar_id":"","url":"https://api.github.com/users/mojavelinux","html_url":"https://github.com/mojavelinux","followers_url":"https://api.github.com/users/mojavelinux/followers","following_url":"https://api.github.com/users/mojavelinux/following{/other_user}","gists_url":"https://api.github.com/users/mojavelinux/gists{/gist_id}","starred_url":"https://api.github.com/users/mojavelinux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mojavelinux/subscriptions","organizations_url":"https://api.github.com/users/mojavelinux/orgs","repos_url":"https://api.github.com/users/mojavelinux/repos","events_url":"https://api.github.com/users/mojavelinux/events{/privacy}","received_events_url":"https://api.github.com/users/mojavelinux/received_events","type":"User","site_admin":false},"open_issues":65,"closed_issues":47,"state":"open","created_at":"2017-03-24T14:37:18Z","updated_at":"2018-02-28T06:47:35Z","due_on":null,"closed_at":null},"comments":8,"created_at":"2017-10-15T19:19:43Z","updated_at":"2018-03-01T03:12:55Z","closed_at":null,"author_association":"MEMBER","body":"I did some tests on the Chrome/Firefox extension and the following include target are working without this special case.\r\n\r\nPlease note that `base_dir` needs to be defined.\r\n`Opal.current_dir` (used in `Dir.pwd`) can also be defined but that's not mandatory.\r\nhttps://github.com/opal/opal/blob/a71e77b87c334096285dd597bd6c6a4d9a9d60e7/opal/corelib/dir.rb#L11-L13\r\n\r\n### `file://` protocol\r\n\r\n#### Firefox\r\n\r\n`base_dir` attribute is equals to `file:///home/guillaume/asciidoctor`.\r\n\r\n* `include::./b.adoc[]` → **OK**\r\n* `include::b.adoc[]` → **OK**\r\n* `include::/home/guillaume/asciidoctor/b.adoc[]` → Firefox  throws an `SyntaxError: \"The URI is malformed.` (1)\r\n* `include::file:///home/guillaume/Documents/asciidoctor/b.adoc[]` → the attribute `allow-uri-read` needs to be defined\r\n\r\n(1) In Asciidoctor.js, we could catch this exception, add the protocol and try to read the file again. Or we could proactively transform the include target to add the protocol if we are running in Firefox.\r\n\r\n#### Chrome\r\n\r\n* `include::./b.adoc[]` → **OK**\r\n* `include::b.adoc[]` → **OK**\r\n* `include::/home/guillaume/asciidoctor/b.adoc[]` → **OK**\r\n* `include::file:///home/guillaume/Documents/asciidoctor/b.adoc[]` → the attribute `allow-uri-read` needs to be defined\r\n\r\n### `http(s)://` protocol\r\n\r\n`http(s)://` paths are not considered as absolute paths for the `is_root` method:\r\n\r\nhttps://github.com/asciidoctor/asciidoctor/blob/a9dc0e23cd49ca428206ed5f29a0be0f9095ee02/lib/asciidoctor/path_resolver.rb#L144-L148\r\n\r\nSo the following exception is thrown: `Jail is not an absolute path: ...`\r\n"},"comment":{"url":"https://api.github.com/repos/asciidoctor/asciidoctor/issues/comments/369460726","html_url":"https://github.com/asciidoctor/asciidoctor/issues/2455#issuecomment-369460726","issue_url":"https://api.github.com/repos/asciidoctor/asciidoctor/issues/2455","id":369460726,"user":{"login":"mojavelinux","id":79351,"avatar_url":"https://avatars2.githubusercontent.com/u/79351?v=4","gravatar_id":"","url":"https://api.github.com/users/mojavelinux","html_url":"https://github.com/mojavelinux","followers_url":"https://api.github.com/users/mojavelinux/followers","following_url":"https://api.github.com/users/mojavelinux/following{/other_user}","gists_url":"https://api.github.com/users/mojavelinux/gists{/gist_id}","starred_url":"https://api.github.com/users/mojavelinux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mojavelinux/subscriptions","organizations_url":"https://api.github.com/users/mojavelinux/orgs","repos_url":"https://api.github.com/users/mojavelinux/repos","events_url":"https://api.github.com/users/mojavelinux/events{/privacy}","received_events_url":"https://api.github.com/users/mojavelinux/received_events","type":"User","site_admin":false},"created_at":"2018-03-01T03:12:55Z","updated_at":"2018-03-01T03:12:55Z","author_association":"OWNER","body":"The more I think about this, the more I think we need to keep the exception, but just improve it.\r\n\r\nIt's very risky to let browser fs paths pass through the same logic as a normal fs path because these two need to be handled in fundamentally different ways.\r\n\r\nWhat we need to do is make sure that if the target is absolute (whether it begins with a URI scheme or its an absolute fs path), the value needs to be preserved. I think that then allows all cases to work properly.\r\n\r\n"}}
{"actor":{"display_login":"mojavelinux"}}