{"action":"created","issue":{"url":"https://api.github.com/repos/jgm/pandoc/issues/2412","labels_url":"https://api.github.com/repos/jgm/pandoc/issues/2412/labels{/name}","comments_url":"https://api.github.com/repos/jgm/pandoc/issues/2412/comments","events_url":"https://api.github.com/repos/jgm/pandoc/issues/2412/events","html_url":"https://github.com/jgm/pandoc/pull/2412","id":108013581,"number":2412,"title":"Added support for <xref> tag in DocBook reader","user":{"login":"frerich","id":533425,"avatar_url":"https://avatars.githubusercontent.com/u/533425?v=3","gravatar_id":"","url":"https://api.github.com/users/frerich","html_url":"https://github.com/frerich","followers_url":"https://api.github.com/users/frerich/followers","following_url":"https://api.github.com/users/frerich/following{/other_user}","gists_url":"https://api.github.com/users/frerich/gists{/gist_id}","starred_url":"https://api.github.com/users/frerich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frerich/subscriptions","organizations_url":"https://api.github.com/users/frerich/orgs","repos_url":"https://api.github.com/users/frerich/repos","events_url":"https://api.github.com/users/frerich/events{/privacy}","received_events_url":"https://api.github.com/users/frerich/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-09-23T21:47:27Z","updated_at":"2015-09-24T14:23:28Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/jgm/pandoc/pulls/2412","html_url":"https://github.com/jgm/pandoc/pull/2412","diff_url":"https://github.com/jgm/pandoc/pull/2412.diff","patch_url":"https://github.com/jgm/pandoc/pull/2412.patch"},"body":"This patch adds proper support for the DocBook <xref> element which is used to create cross references to other parts of the document - see http://www.docbook.org/tdg/en/html/xref.html.\r\n\r\nI didn't see an existing infrastructure to lookup elements by their ID attribute so I introduced a `dbContent` field to the state which can be used to access the DocBook file being read. As it is, the tree is searched for some element matching a given `id` every time an `<xref>` element is found. If this turns out to be too much of a slowdown for documents which make use of a lot of cross references, some simple cache (`M.Map String Element` or so) might help.\r\n\r\nThe same logic for referencing other elements would probably be useful for similiar elements, e.g. `<link>`."},"comment":{"url":"https://api.github.com/repos/jgm/pandoc/issues/comments/142944730","html_url":"https://github.com/jgm/pandoc/pull/2412#issuecomment-142944730","issue_url":"https://api.github.com/repos/jgm/pandoc/issues/2412","id":142944730,"user":{"login":"frerich","id":533425,"avatar_url":"https://avatars.githubusercontent.com/u/533425?v=3","gravatar_id":"","url":"https://api.github.com/users/frerich","html_url":"https://github.com/frerich","followers_url":"https://api.github.com/users/frerich/followers","following_url":"https://api.github.com/users/frerich/following{/other_user}","gists_url":"https://api.github.com/users/frerich/gists{/gist_id}","starred_url":"https://api.github.com/users/frerich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frerich/subscriptions","organizations_url":"https://api.github.com/users/frerich/orgs","repos_url":"https://api.github.com/users/frerich/repos","events_url":"https://api.github.com/users/frerich/events{/privacy}","received_events_url":"https://api.github.com/users/frerich/received_events","type":"User","site_admin":false},"created_at":"2015-09-24T14:23:28Z","updated_at":"2015-09-24T14:23:28Z","body":"By now, I suspect that I should augment commit 76af74b such that the parsed href is prepended with a hash character (`#`). It appears this is conventional, and at least the HTML output seems to rely on it.\r\n\r\nStill, it feels wrong to do it in a reader - but I guess right now there is no way to distinguish cross-references from references to other files in the native model..."}}