{"action":"created","comment":{"url":"https://api.github.com/repos/D-Programming-Language/dmd/pulls/comments/22650815","id":22650815,"diff_hunk":"@@ -2325,6 +2327,41 @@ void highlightText(Scope *sc, Dsymbol *s, OutBuffer *buf, size_t offset)\n                 }\n                 break;\n \n+            case '`':\n+                if (inBacktick)\n+                {\n+                    inBacktick = 0;\n+                    inCode = 0;\n+\n+                    OutBuffer codebuf;\n+\n+                    codebuf.write(buf->data + iCodeStart + 1, i - (iCodeStart + 1));\n+                    codebuf.writeByte(0);\n+\n+                    highlightCode2(sc, s, &codebuf, 0);\n+\n+                    buf->remove(iCodeStart, i - iCodeStart + 1); // also trimming off the current `\n+                    i = buf->insert(iCodeStart, codebuf.data, codebuf.offset);\n+                    i = buf->insert(i, \")\", 1);\n+\n+                    break;\n+                }\n+\n+                if (inCode)\n+                    break;\n+\n+                inCode = 1;\n+                inBacktick = 1;\n+\n+                static const char pre[] = \"$(D_INLINECODE \";","path":"src/doc.c","position":54,"original_position":46,"commit_id":"dd07fcbdb4f63e775b996e46aba755041277006c","original_commit_id":"8c3a4f92e3f099f5a2ac24666be10946addc13d5","user":{"login":"adamdruppe","id":600799,"avatar_url":"https://avatars.githubusercontent.com/u/600799?v=3","gravatar_id":"","url":"https://api.github.com/users/adamdruppe","html_url":"https://github.com/adamdruppe","followers_url":"https://api.github.com/users/adamdruppe/followers","following_url":"https://api.github.com/users/adamdruppe/following{/other_user}","gists_url":"https://api.github.com/users/adamdruppe/gists{/gist_id}","starred_url":"https://api.github.com/users/adamdruppe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adamdruppe/subscriptions","organizations_url":"https://api.github.com/users/adamdruppe/orgs","repos_url":"https://api.github.com/users/adamdruppe/repos","events_url":"https://api.github.com/users/adamdruppe/events{/privacy}","received_events_url":"https://api.github.com/users/adamdruppe/received_events","type":"User","site_admin":false},"body":"On Wed, Jan 07, 2015 at 08:05:20AM -0800, Andrei Alexandrescu wrote:\n> I don't agree with your disagreement. How is it not syntactic sugar lowered to another macro? This is exactly what it is!\n\nIt also calls the highlight code function, transforming the string\nbefore the macro is run.\n\nThe text `int < foo`, for example, becomes\n\n$(D_INLINECODE $(D_KEYWORD int) &lt; foo)\n\nThe escaping and syntax highlighting wouldn't be done in a regular\nmacro. (BTW, I could do without syntax highlighting, but the escaping\nis an absolute must-have so you can do html code examples in the ticks\nand the syntax highlighting is the only function in ddoc that performs\nescaping.)","created_at":"2015-01-08T13:18:33Z","updated_at":"2015-01-08T13:18:33Z","html_url":"https://github.com/D-Programming-Language/dmd/pull/4228#discussion_r22650815","pull_request_url":"https://api.github.com/repos/D-Programming-Language/dmd/pulls/4228","_links":{"self":{"href":"https://api.github.com/repos/D-Programming-Language/dmd/pulls/comments/22650815"},"html":{"href":"https://github.com/D-Programming-Language/dmd/pull/4228#discussion_r22650815"},"pull_request":{"href":"https://api.github.com/repos/D-Programming-Language/dmd/pulls/4228"}}},"pull_request":{"url":"https://api.github.com/repos/D-Programming-Language/dmd/pulls/4228","id":26744368,"html_url":"https://github.com/D-Programming-Language/dmd/pull/4228","diff_url":"https://github.com/D-Programming-Language/dmd/pull/4228.diff","patch_url":"https://github.com/D-Programming-Language/dmd/pull/4228.patch","issue_url":"https://api.github.com/repos/D-Programming-Language/dmd/issues/4228","number":4228,"state":"open","locked":false,"title":"Backtick inline code","user":{"login":"adamdruppe","id":600799,"avatar_url":"https://avatars.githubusercontent.com/u/600799?v=3","gravatar_id":"","url":"https://api.github.com/users/adamdruppe","html_url":"https://github.com/adamdruppe","followers_url":"https://api.github.com/users/adamdruppe/followers","following_url":"https://api.github.com/users/adamdruppe/following{/other_user}","gists_url":"https://api.github.com/users/adamdruppe/gists{/gist_id}","starred_url":"https://api.github.com/users/adamdruppe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adamdruppe/subscriptions","organizations_url":"https://api.github.com/users/adamdruppe/orgs","repos_url":"https://api.github.com/users/adamdruppe/repos","events_url":"https://api.github.com/users/adamdruppe/events{/privacy}","received_events_url":"https://api.github.com/users/adamdruppe/received_events","type":"User","site_admin":false},"body":"This supports `code` with backticks in ddoc. It passes it through the same code that handles the --- example --- sections, so we get exactly the same escaping and highlighting behavior, (and cross referencing when that gets added).\r\n\r\nThe only difference is it outputs it in a D_INLINECODE macro instead of D_CODE. My default definition of this macro uses html pre with inline style, so it displays as expected.\r\n\r\nThe test file I used to eyeball it is here:\r\nhttp://arsdnet.net/dcode/example.d\r\nhttp://arsdnet.net/dcode/example.html\r\n\r\n\r\nThe backtick syntax is used on Stack Overflow and GitHub so a lot of people are used to it and it looks pretty decent. Raw string literals in the raw text will change due to this, but they typically are inside an example block anyway which continues to work the same as before.\r\n\r\nThis should be a win for the Markdown advocating crowd with virtually zero cost to everyone else. It also gives me the xml escaping I've been begging for by just backticking it, solving my biggest problem with ddoc!","created_at":"2015-01-01T16:23:54Z","updated_at":"2015-01-08T13:18:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c4414bef813ce5e558a231a7aa08ac5d5eacbfc4","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/D-Programming-Language/dmd/pulls/4228/commits","review_comments_url":"https://api.github.com/repos/D-Programming-Language/dmd/pulls/4228/comments","review_comment_url":"https://api.github.com/repos/D-Programming-Language/dmd/pulls/comments/{number}","comments_url":"https://api.github.com/repos/D-Programming-Language/dmd/issues/4228/comments","statuses_url":"https://api.github.com/repos/D-Programming-Language/dmd/statuses/dd07fcbdb4f63e775b996e46aba755041277006c","head":{"label":"adamdruppe:ddoc_dcode","ref":"ddoc_dcode","sha":"dd07fcbdb4f63e775b996e46aba755041277006c","user":{"login":"adamdruppe","id":600799,"avatar_url":"https://avatars.githubusercontent.com/u/600799?v=3","gravatar_id":"","url":"https://api.github.com/users/adamdruppe","html_url":"https://github.com/adamdruppe","followers_url":"https://api.github.com/users/adamdruppe/followers","following_url":"https://api.github.com/users/adamdruppe/following{/other_user}","gists_url":"https://api.github.com/users/adamdruppe/gists{/gist_id}","starred_url":"https://api.github.com/users/adamdruppe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adamdruppe/subscriptions","organizations_url":"https://api.github.com/users/adamdruppe/orgs","repos_url":"https://api.github.com/users/adamdruppe/repos","events_url":"https://api.github.com/users/adamdruppe/events{/privacy}","received_events_url":"https://api.github.com/users/adamdruppe/received_events","type":"User","site_admin":false},"repo":{"id":3481014,"name":"dmd","full_name":"adamdruppe/dmd","owner":{"login":"adamdruppe","id":600799,"avatar_url":"https://avatars.githubusercontent.com/u/600799?v=3","gravatar_id":"","url":"https://api.github.com/users/adamdruppe","html_url":"https://github.com/adamdruppe","followers_url":"https://api.github.com/users/adamdruppe/followers","following_url":"https://api.github.com/users/adamdruppe/following{/other_user}","gists_url":"https://api.github.com/users/adamdruppe/gists{/gist_id}","starred_url":"https://api.github.com/users/adamdruppe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adamdruppe/subscriptions","organizations_url":"https://api.github.com/users/adamdruppe/orgs","repos_url":"https://api.github.com/users/adamdruppe/repos","events_url":"https://api.github.com/users/adamdruppe/events{/privacy}","received_events_url":"https://api.github.com/users/adamdruppe/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/adamdruppe/dmd","description":"dmd D Programming Language compiler","fork":true,"url":"https://api.github.com/repos/adamdruppe/dmd","forks_url":"https://api.github.com/repos/adamdruppe/dmd/forks","keys_url":"https://api.github.com/repos/adamdruppe/dmd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/adamdruppe/dmd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/adamdruppe/dmd/teams","hooks_url":"https://api.github.com/repos/adamdruppe/dmd/hooks","issue_events_url":"https://api.github.com/repos/adamdruppe/dmd/issues/events{/number}","events_url":"https://api.github.com/repos/adamdruppe/dmd/events","assignees_url":"https://api.github.com/repos/adamdruppe/dmd/assignees{/user}","branches_url":"https://api.github.com/repos/adamdruppe/dmd/branches{/branch}","tags_url":"https://api.github.com/repos/adamdruppe/dmd/tags","blobs_url":"https://api.github.com/repos/adamdruppe/dmd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/adamdruppe/dmd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/adamdruppe/dmd/git/refs{/sha}","trees_url":"https://api.github.com/repos/adamdruppe/dmd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/adamdruppe/dmd/statuses/{sha}","languages_url":"https://api.github.com/repos/adamdruppe/dmd/languages","stargazers_url":"https://api.github.com/repos/adamdruppe/dmd/stargazers","contributors_url":"https://api.github.com/repos/adamdruppe/dmd/contributors","subscribers_url":"https://api.github.com/repos/adamdruppe/dmd/subscribers","subscription_url":"https://api.github.com/repos/adamdruppe/dmd/subscription","commits_url":"https://api.github.com/repos/adamdruppe/dmd/commits{/sha}","git_commits_url":"https://api.github.com/repos/adamdruppe/dmd/git/commits{/sha}","comments_url":"https://api.github.com/repos/adamdruppe/dmd/comments{/number}","issue_comment_url":"https://api.github.com/repos/adamdruppe/dmd/issues/comments/{number}","contents_url":"https://api.github.com/repos/adamdruppe/dmd/contents/{+path}","compare_url":"https://api.github.com/repos/adamdruppe/dmd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/adamdruppe/dmd/merges","archive_url":"https://api.github.com/repos/adamdruppe/dmd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/adamdruppe/dmd/downloads","issues_url":"https://api.github.com/repos/adamdruppe/dmd/issues{/number}","pulls_url":"https://api.github.com/repos/adamdruppe/dmd/pulls{/number}","milestones_url":"https://api.github.com/repos/adamdruppe/dmd/milestones{/number}","notifications_url":"https://api.github.com/repos/adamdruppe/dmd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/adamdruppe/dmd/labels{/name}","releases_url":"https://api.github.com/repos/adamdruppe/dmd/releases{/id}","created_at":"2012-02-18T20:51:28Z","updated_at":"2015-01-01T14:39:25Z","pushed_at":"2015-01-06T01:40:43Z","git_url":"git://github.com/adamdruppe/dmd.git","ssh_url":"git@github.com:adamdruppe/dmd.git","clone_url":"https://github.com/adamdruppe/dmd.git","svn_url":"https://github.com/adamdruppe/dmd","homepage":"d-programming-language.org","size":41996,"stargazers_count":6,"watchers_count":6,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":6,"default_branch":"master"}},"base":{"label":"D-Programming-Language:master","ref":"master","sha":"d7ef79918c905f337ceb738c03925204cd291a62","user":{"login":"D-Programming-Language","id":565913,"avatar_url":"https://avatars.githubusercontent.com/u/565913?v=3","gravatar_id":"","url":"https://api.github.com/users/D-Programming-Language","html_url":"https://github.com/D-Programming-Language","followers_url":"https://api.github.com/users/D-Programming-Language/followers","following_url":"https://api.github.com/users/D-Programming-Language/following{/other_user}","gists_url":"https://api.github.com/users/D-Programming-Language/gists{/gist_id}","starred_url":"https://api.github.com/users/D-Programming-Language/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/D-Programming-Language/subscriptions","organizations_url":"https://api.github.com/users/D-Programming-Language/orgs","repos_url":"https://api.github.com/users/D-Programming-Language/repos","events_url":"https://api.github.com/users/D-Programming-Language/events{/privacy}","received_events_url":"https://api.github.com/users/D-Programming-Language/received_events","type":"Organization","site_admin":false},"repo":{"id":1257070,"name":"dmd","full_name":"D-Programming-Language/dmd","owner":{"login":"D-Programming-Language","id":565913,"avatar_url":"https://avatars.githubusercontent.com/u/565913?v=3","gravatar_id":"","url":"https://api.github.com/users/D-Programming-Language","html_url":"https://github.com/D-Programming-Language","followers_url":"https://api.github.com/users/D-Programming-Language/followers","following_url":"https://api.github.com/users/D-Programming-Language/following{/other_user}","gists_url":"https://api.github.com/users/D-Programming-Language/gists{/gist_id}","starred_url":"https://api.github.com/users/D-Programming-Language/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/D-Programming-Language/subscriptions","organizations_url":"https://api.github.com/users/D-Programming-Language/orgs","repos_url":"https://api.github.com/users/D-Programming-Language/repos","events_url":"https://api.github.com/users/D-Programming-Language/events{/privacy}","received_events_url":"https://api.github.com/users/D-Programming-Language/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/D-Programming-Language/dmd","description":"dmd D Programming Language compiler","fork":false,"url":"https://api.github.com/repos/D-Programming-Language/dmd","forks_url":"https://api.github.com/repos/D-Programming-Language/dmd/forks","keys_url":"https://api.github.com/repos/D-Programming-Language/dmd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/D-Programming-Language/dmd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/D-Programming-Language/dmd/teams","hooks_url":"https://api.github.com/repos/D-Programming-Language/dmd/hooks","issue_events_url":"https://api.github.com/repos/D-Programming-Language/dmd/issues/events{/number}","events_url":"https://api.github.com/repos/D-Programming-Language/dmd/events","assignees_url":"https://api.github.com/repos/D-Programming-Language/dmd/assignees{/user}","branches_url":"https://api.github.com/repos/D-Programming-Language/dmd/branches{/branch}","tags_url":"https://api.github.com/repos/D-Programming-Language/dmd/tags","blobs_url":"https://api.github.com/repos/D-Programming-Language/dmd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/D-Programming-Language/dmd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/D-Programming-Language/dmd/git/refs{/sha}","trees_url":"https://api.github.com/repos/D-Programming-Language/dmd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/D-Programming-Language/dmd/statuses/{sha}","languages_url":"https://api.github.com/repos/D-Programming-Language/dmd/languages","stargazers_url":"https://api.github.com/repos/D-Programming-Language/dmd/stargazers","contributors_url":"https://api.github.com/repos/D-Programming-Language/dmd/contributors","subscribers_url":"https://api.github.com/repos/D-Programming-Language/dmd/subscribers","subscription_url":"https://api.github.com/repos/D-Programming-Language/dmd/subscription","commits_url":"https://api.github.com/repos/D-Programming-Language/dmd/commits{/sha}","git_commits_url":"https://api.github.com/repos/D-Programming-Language/dmd/git/commits{/sha}","comments_url":"https://api.github.com/repos/D-Programming-Language/dmd/comments{/number}","issue_comment_url":"https://api.github.com/repos/D-Programming-Language/dmd/issues/comments/{number}","contents_url":"https://api.github.com/repos/D-Programming-Language/dmd/contents/{+path}","compare_url":"https://api.github.com/repos/D-Programming-Language/dmd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/D-Programming-Language/dmd/merges","archive_url":"https://api.github.com/repos/D-Programming-Language/dmd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/D-Programming-Language/dmd/downloads","issues_url":"https://api.github.com/repos/D-Programming-Language/dmd/issues{/number}","pulls_url":"https://api.github.com/repos/D-Programming-Language/dmd/pulls{/number}","milestones_url":"https://api.github.com/repos/D-Programming-Language/dmd/milestones{/number}","notifications_url":"https://api.github.com/repos/D-Programming-Language/dmd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/D-Programming-Language/dmd/labels{/name}","releases_url":"https://api.github.com/repos/D-Programming-Language/dmd/releases{/id}","created_at":"2011-01-15T06:53:53Z","updated_at":"2015-01-08T06:14:49Z","pushed_at":"2015-01-08T06:14:48Z","git_url":"git://github.com/D-Programming-Language/dmd.git","ssh_url":"git@github.com:D-Programming-Language/dmd.git","clone_url":"https://github.com/D-Programming-Language/dmd.git","svn_url":"https://github.com/D-Programming-Language/dmd","homepage":"dlang.org","size":78991,"stargazers_count":894,"watchers_count":894,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":287,"mirror_url":null,"open_issues_count":94,"forks":287,"open_issues":94,"watchers":894,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/D-Programming-Language/dmd/pulls/4228"},"html":{"href":"https://github.com/D-Programming-Language/dmd/pull/4228"},"issue":{"href":"https://api.github.com/repos/D-Programming-Language/dmd/issues/4228"},"comments":{"href":"https://api.github.com/repos/D-Programming-Language/dmd/issues/4228/comments"},"review_comments":{"href":"https://api.github.com/repos/D-Programming-Language/dmd/pulls/4228/comments"},"review_comment":{"href":"https://api.github.com/repos/D-Programming-Language/dmd/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/D-Programming-Language/dmd/pulls/4228/commits"},"statuses":{"href":"https://api.github.com/repos/D-Programming-Language/dmd/statuses/dd07fcbdb4f63e775b996e46aba755041277006c"}}}}