{"action":"created","issue":{"url":"https://api.github.com/repos/dita-ot/dita-ot/issues/3027","repository_url":"https://api.github.com/repos/dita-ot/dita-ot","labels_url":"https://api.github.com/repos/dita-ot/dita-ot/issues/3027/labels{/name}","comments_url":"https://api.github.com/repos/dita-ot/dita-ot/issues/3027/comments","events_url":"https://api.github.com/repos/dita-ot/dita-ot/issues/3027/events","html_url":"https://github.com/dita-ot/dita-ot/pull/3027","id":345361626,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA0NTM2MjEx","number":3027,"title":"Fix #./element style XREF that is pulled with conref","user":{"login":"robander","id":1649639,"node_id":"MDQ6VXNlcjE2NDk2Mzk=","avatar_url":"https://avatars2.githubusercontent.com/u/1649639?v=4","gravatar_id":"","url":"https://api.github.com/users/robander","html_url":"https://github.com/robander","followers_url":"https://api.github.com/users/robander/followers","following_url":"https://api.github.com/users/robander/following{/other_user}","gists_url":"https://api.github.com/users/robander/gists{/gist_id}","starred_url":"https://api.github.com/users/robander/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robander/subscriptions","organizations_url":"https://api.github.com/users/robander/orgs","repos_url":"https://api.github.com/users/robander/repos","events_url":"https://api.github.com/users/robander/events{/privacy}","received_events_url":"https://api.github.com/users/robander/received_events","type":"User","site_admin":false},"labels":[{"id":4492119,"node_id":"MDU6TGFiZWw0NDkyMTE5","url":"https://api.github.com/repos/dita-ot/dita-ot/labels/P2","name":"P2","color":"e102d8","default":false},{"id":3169078,"node_id":"MDU6TGFiZWwzMTY5MDc4","url":"https://api.github.com/repos/dita-ot/dita-ot/labels/bug","name":"bug","color":"d93f0b","default":true},{"id":258597640,"node_id":"MDU6TGFiZWwyNTg1OTc2NDA=","url":"https://api.github.com/repos/dita-ot/dita-ot/labels/preprocess/conref","name":"preprocess/conref","color":"84b6e8","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-07-27T20:47:09Z","updated_at":"2018-08-01T16:45:03Z","closed_at":null,"author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/dita-ot/dita-ot/pulls/3027","html_url":"https://github.com/dita-ot/dita-ot/pull/3027","diff_url":"https://github.com/dita-ot/dita-ot/pull/3027.diff","patch_url":"https://github.com/dita-ot/dita-ot/pull/3027.patch"},"body":"## Description\r\n\r\nFixes a bug in processing of `href=\"#./fig\"` style \"same-topic\" references that are pulled with conref.\r\n\r\nThe specification describes how to process `<xref>` elements within content that is referenced with `@conref`:\r\n\r\n> When the address is a same-topic fragment identifier, processors _MUST_ resolve it relative to the location of the content reference (referencing context). \r\n\r\nSee the [spec topic on xref with conref]((https://docs.oasis-open.org/dita/dita/v1.3/errata02/os/complete/part1-base/archSpec/base/handling-xref-and-conref-within-topics.html). There is an example of this exact case (paragraph `C` referencing `p3`) showing the expected result.\r\n\r\nCurrently, when _any_ local cross reference begins with `#` and is pulled into another file via `@conref`, it is treated the same way: the file name of the original file is added so that the resulting link always goes to the original file. This is correct for links that begin with a topic ID such as `#topic`, but the `#.` syntax is explicitly intended as a way around this behavior, allowing pulled cross references to link to an ID within the _referencing_ file. The result today is always broken.\r\n\r\n## Motivation and Context\r\n\r\nReported as a bug by one of my internal customers, who was pulling a section with cross references into another topic as part of a PDF publishing process. The resulting PDF ends up with broken links (the target of the `@conref` is not part of the PDF; even when part of the PDF, the link is still broken, because the modified href value `filename.dita#./d1e123` is invalid). \r\n\r\nThis does *not* handle the case where you might have a section that includes both `id=\"test\"` and `href=\"#./test\"`. This cannot be handled with the current code, which always modifies IDs to generated values to ensure the resulting topic is correct. I think any fix for that issue likely requires larger design changes inappropriate for a hotfix.\r\n\r\n## How Has This Been Tested?\r\n\r\nTested with a document based on the source I originally got with the problem.\r\n\r\nAlso updated an existing Integration test case where `@conref` pulls in a section full of `#topic` style cross references, so that it also tests the `#.` condition.\r\n\r\n## Type of Changes\r\n\r\n- Bug fix _(non-breaking change which fixes an issue)_\r\n\r\n## Checklist\r\n\r\nX My code follows the code style of this project.\r\n    -  <https://github.com/dita-ot/dita-ot/wiki/Java-Coding-Conventions>\r\n    -  <https://github.com/dita-ot/dita-ot/wiki/XSLT-Coding-Conventions>\r\nX I have updated the unit tests to reflect the changes in my code.\r\n"},"comment":{"url":"https://api.github.com/repos/dita-ot/dita-ot/issues/comments/409641446","html_url":"https://github.com/dita-ot/dita-ot/pull/3027#issuecomment-409641446","issue_url":"https://api.github.com/repos/dita-ot/dita-ot/issues/3027","id":409641446,"node_id":"MDEyOklzc3VlQ29tbWVudDQwOTY0MTQ0Ng==","user":{"login":"robander","id":1649639,"node_id":"MDQ6VXNlcjE2NDk2Mzk=","avatar_url":"https://avatars2.githubusercontent.com/u/1649639?v=4","gravatar_id":"","url":"https://api.github.com/users/robander","html_url":"https://github.com/robander","followers_url":"https://api.github.com/users/robander/followers","following_url":"https://api.github.com/users/robander/following{/other_user}","gists_url":"https://api.github.com/users/robander/gists{/gist_id}","starred_url":"https://api.github.com/users/robander/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robander/subscriptions","organizations_url":"https://api.github.com/users/robander/orgs","repos_url":"https://api.github.com/users/robander/repos","events_url":"https://api.github.com/users/robander/events{/privacy}","received_events_url":"https://api.github.com/users/robander/received_events","type":"User","site_admin":false},"created_at":"2018-08-01T16:45:03Z","updated_at":"2018-08-01T16:45:03Z","author_association":"MEMBER","body":"RE: the \"not handled\" portion in the original pull request:\r\n> This does _not_ handle the case where you might have a section that includes both id=\"test\" and href=\"#./test\". This cannot be handled with the current code, which always modifies IDs to generated values to ensure the resulting topic is correct. I think any fix for that issue likely requires larger design changes inappropriate for a hotfix.\r\n\r\nI've just noticed that larger issue is open as its own item, #1691"}}
{"actor":{"display_login":"robander"}}