{"action":"created","issue":{"url":"https://api.github.com/repos/asciidoctor/asciidoctor/issues/2369","repository_url":"https://api.github.com/repos/asciidoctor/asciidoctor","labels_url":"https://api.github.com/repos/asciidoctor/asciidoctor/issues/2369/labels{/name}","comments_url":"https://api.github.com/repos/asciidoctor/asciidoctor/issues/2369/comments","events_url":"https://api.github.com/repos/asciidoctor/asciidoctor/issues/2369/events","html_url":"https://github.com/asciidoctor/asciidoctor/issues/2369","id":250363191,"number":2369,"title":"Potential regression on tag inclusion in 1.5.6.1","user":{"login":"cexbrayat","id":411874,"avatar_url":"https://avatars3.githubusercontent.com/u/411874?v=4","gravatar_id":"","url":"https://api.github.com/users/cexbrayat","html_url":"https://github.com/cexbrayat","followers_url":"https://api.github.com/users/cexbrayat/followers","following_url":"https://api.github.com/users/cexbrayat/following{/other_user}","gists_url":"https://api.github.com/users/cexbrayat/gists{/gist_id}","starred_url":"https://api.github.com/users/cexbrayat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cexbrayat/subscriptions","organizations_url":"https://api.github.com/users/cexbrayat/orgs","repos_url":"https://api.github.com/users/cexbrayat/repos","events_url":"https://api.github.com/users/cexbrayat/events{/privacy}","received_events_url":"https://api.github.com/users/cexbrayat/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/asciidoctor/asciidoctor/milestones/11","html_url":"https://github.com/asciidoctor/asciidoctor/milestone/11","labels_url":"https://api.github.com/repos/asciidoctor/asciidoctor/milestones/11/labels","id":390759,"number":11,"title":"discussion","description":"Issues that are still in the planning or design phase. If one of these issues is still open, either a decision hasn't been made about what to implement or actions are being taken elsewhere.","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":40,"closed_issues":12,"state":"open","created_at":"2013-07-30T23:51:36Z","updated_at":"2018-02-24T06:53:41Z","due_on":null,"closed_at":null},"comments":10,"created_at":"2017-08-15T16:15:24Z","updated_at":"2018-04-13T20:47:05Z","closed_at":null,"author_association":"NONE","body":"Previously, using `1.5.5`, we could do something like:\r\n\r\n```asciidoc\r\n= Hello, AsciiDoc!\r\ninclude::include.ts[tags=h1]\r\n```\r\n\r\nwith `include.ts` looking like:\r\n\r\n```typescript\r\nconst template = `\r\n<body>\r\n  <!-- tag::h1[] -->\r\n  <h1>Hello</h1>\r\n  <!-- end::h1[] -->\r\n</body>`;\r\n```\r\n\r\nwhich was producing the expected result:\r\n<img width=\"404\" alt=\"capture d ecran 2017-08-15 a 18 14 04\" src=\"https://user-images.githubusercontent.com/411874/29324774-9e9bd6da-81e5-11e7-851f-5d68fc9a9eab.png\">\r\n\r\n\r\nUpgrading to `1.5.6.1` leads to the following error:\r\n\r\n```\r\nasciidoctor: WARNING: issue.adoc: line 2: tag 'h1' not found in include file: /Users/cedric/Code/tests/ascidoctor-tag-issue/include.ts\r\n```\r\n\r\nand the HTML is no longer displayed.\r\n\r\nThis is a minimal reproduction, but I've seen it on every project I tried to bump to the latest release."},"comment":{"url":"https://api.github.com/repos/asciidoctor/asciidoctor/issues/comments/381256488","html_url":"https://github.com/asciidoctor/asciidoctor/issues/2369#issuecomment-381256488","issue_url":"https://api.github.com/repos/asciidoctor/asciidoctor/issues/2369","id":381256488,"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-04-13T20:47:05Z","updated_at":"2018-04-13T20:47:05Z","author_association":"OWNER","body":"After giving this more thought, what I've come to realize is that the file extension is not a reliable indicator of the contents (putting aside the fact that we don't want to have to maintain a file extension list). The contents can have a mix of languages, either because the language supports it or because the language is embedded inside a multi-line string.\r\n\r\nA better way to approach is to look for lines that have a trailing circumfix comment delimiter, then validate that its pair is present earlier in the line. That way, we're sure we've identified a line with a circumfix comment. Then we proceed to strip the trailing delimiter and look for a tag at the end of the line. This is both efficient and solves the problem at hand (and we no longer have to maintain a list of file extensions)."}}
{"actor":{"display_login":"mojavelinux"}}