{"action":"created","issue":{"url":"https://api.github.com/repos/mity/md4c/issues/5","repository_url":"https://api.github.com/repos/mity/md4c","labels_url":"https://api.github.com/repos/mity/md4c/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/mity/md4c/issues/5/comments","events_url":"https://api.github.com/repos/mity/md4c/issues/5/events","html_url":"https://github.com/mity/md4c/issues/5","id":194202136,"number":5,"title":"Entities in non-trivial contexts","user":{"login":"mity","id":873269,"avatar_url":"https://avatars.githubusercontent.com/u/873269?v=3","gravatar_id":"","url":"https://api.github.com/users/mity","html_url":"https://github.com/mity","followers_url":"https://api.github.com/users/mity/followers","following_url":"https://api.github.com/users/mity/following{/other_user}","gists_url":"https://api.github.com/users/mity/gists{/gist_id}","starred_url":"https://api.github.com/users/mity/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mity/subscriptions","organizations_url":"https://api.github.com/users/mity/orgs","repos_url":"https://api.github.com/users/mity/repos","events_url":"https://api.github.com/users/mity/events{/privacy}","received_events_url":"https://api.github.com/users/mity/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":16,"created_at":"2016-12-07T23:18:27Z","updated_at":"2016-12-12T18:03:30Z","closed_at":null,"body":"Entities which are not inside a normal text flow are not translated.\r\n\r\nThis includes these situations:\r\n* Entity inside a link or image destination (URL).\r\n* Entity inside a link or image title text.\r\n* Entity inside a code fence info string.\r\n\r\nIt is responsible for following CommonMark 0.27 test failures.\r\n* [Example 307](http://spec.commonmark.org/0.27/#example-307): In link destination and title\r\n* [Example 308](http://spec.commonmark.org/0.27/#example-308): In link destination and title\r\n* [Example 309](http://spec.commonmark.org/0.27/#example-309): In code fence info string\r\n* [Example 472](http://spec.commonmark.org/0.27/#example-472): In link destination\r\n* [Example 475](http://spec.commonmark.org/0.27/#example-475): In link title\r\n"},"comment":{"url":"https://api.github.com/repos/mity/md4c/issues/comments/266504135","html_url":"https://github.com/mity/md4c/issues/5#issuecomment-266504135","issue_url":"https://api.github.com/repos/mity/md4c/issues/5","id":266504135,"user":{"login":"tin-pot","id":1289260,"avatar_url":"https://avatars.githubusercontent.com/u/1289260?v=3","gravatar_id":"","url":"https://api.github.com/users/tin-pot","html_url":"https://github.com/tin-pot","followers_url":"https://api.github.com/users/tin-pot/followers","following_url":"https://api.github.com/users/tin-pot/following{/other_user}","gists_url":"https://api.github.com/users/tin-pot/gists{/gist_id}","starred_url":"https://api.github.com/users/tin-pot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tin-pot/subscriptions","organizations_url":"https://api.github.com/users/tin-pot/orgs","repos_url":"https://api.github.com/users/tin-pot/repos","events_url":"https://api.github.com/users/tin-pot/events{/privacy}","received_events_url":"https://api.github.com/users/tin-pot/received_events","type":"User","site_admin":false},"created_at":"2016-12-12T18:03:30Z","updated_at":"2016-12-12T18:03:30Z","body":"This looks alright to me. According to your description, a renderer could process all the portions (or chunks, or segments, ...) in the text like this, right?\r\n\r\n    /*\r\n     * Process one \"chunk\" of text, given its type.\r\n     */\r\n    void process(MD_TEXTTYPE, const MD_CHAR[], MD_SIZE);\r\n\r\n    const MD_ATTRIBUTE *pattr; /* Passed in from the parser */\r\n\r\n    /*\r\n     * Loop over chunks in `*pattr`, and process them.\r\n     */\r\n    MD_OFFSET ofs;\r\n    size_t    k;\r\n\r\n    for (k = 0; (ofs = pattr->substr_offsets[k]) < pattr->size; ++k) {\r\n        const MD_CHAR *const chunkp  = pattr->text + ofs;\r\n        const MD_SIZE        chunksz = pattr->substr_offsets[k+1] - ofs;\r\n        const MD_TEXTTYPE    chunktp = pattr->substr_types[k];\r\n\r\n        process(chunktp, chunkp, chunksz);\r\n    }\r\n\r\nUsing an array of *sizes* instead of *offsets* would lead to a loop construct like this. I'm not sure which is better; there's probably not that much difference&nbsp;&hellip;\r\n\r\n    MD_OFFSET ofs;\r\n    MD_SIZE   sz;\r\n    size_t    k;\r\n\r\n    for (k = 0; ofs < pattr->size; ofs += sz, ++k) {\r\n        const MD_CHAR *const chunkp  = ofs;\r\n        const MD_SIZE        chunksz = (sz = pattr->substr_sizes[k]);\r\n        const MD_TEXTTYPE    chunktp = pattr->substr_types[k];\r\n\r\n        process(chunktp, chunkp, chunksz);\r\n    }\r\n"}}
{"actor":{"display_login":"tin-pot"}}