{"action":"created","issue":{"url":"https://api.github.com/repos/github/markup/issues/540","labels_url":"https://api.github.com/repos/github/markup/issues/540/labels{/name}","comments_url":"https://api.github.com/repos/github/markup/issues/540/comments","events_url":"https://api.github.com/repos/github/markup/issues/540/events","html_url":"https://github.com/github/markup/issues/540","id":102587134,"number":540,"title":"Improve specification of source language in code blocks.","user":{"login":"ioquatix","id":30030,"avatar_url":"https://avatars.githubusercontent.com/u/30030?v=3","gravatar_id":"","url":"https://api.github.com/users/ioquatix","html_url":"https://github.com/ioquatix","followers_url":"https://api.github.com/users/ioquatix/followers","following_url":"https://api.github.com/users/ioquatix/following{/other_user}","gists_url":"https://api.github.com/users/ioquatix/gists{/gist_id}","starred_url":"https://api.github.com/users/ioquatix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ioquatix/subscriptions","organizations_url":"https://api.github.com/users/ioquatix/orgs","repos_url":"https://api.github.com/users/ioquatix/repos","events_url":"https://api.github.com/users/ioquatix/events{/privacy}","received_events_url":"https://api.github.com/users/ioquatix/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":12,"created_at":"2015-08-23T04:40:04Z","updated_at":"2015-08-23T17:36:04Z","closed_at":"2015-08-23T17:36:04Z","body":"In typical markdown README, I usually write code using indentation, e.g.\r\n\r\n```\r\nParagraph text...\r\n\r\n    code\r\n    code\r\n    code\r\n```\r\n\r\nUnfortunately syntax highlighting does not appear to be possible using this way. Apparently you need to use three back ticks.\r\n\r\nBut when using three back ticks, it does not appear to allow indentation (it's also kind of ugly when reading the raw readme).\r\n\r\n```\r\n    ```ruby\r\n    code = 10\r\n    ```\r\n```\r\n\r\nSo we must write like this\r\n\r\n```\r\n```ruby\r\ncode = 10\r\n\\```\r\n```\r\n\r\n(ignore the \\)\r\n\r\nThe code is flush wiht the left hand side which IMHO is less readable between paragraphs of text explaining what it is doing.\r\n\r\nThere should be some way to specify the code language for indented blocks."},"comment":{"url":"https://api.github.com/repos/github/markup/issues/comments/133881178","html_url":"https://github.com/github/markup/issues/540#issuecomment-133881178","issue_url":"https://api.github.com/repos/github/markup/issues/540","id":133881178,"user":{"login":"gjtorikian","id":64050,"avatar_url":"https://avatars.githubusercontent.com/u/64050?v=3","gravatar_id":"","url":"https://api.github.com/users/gjtorikian","html_url":"https://github.com/gjtorikian","followers_url":"https://api.github.com/users/gjtorikian/followers","following_url":"https://api.github.com/users/gjtorikian/following{/other_user}","gists_url":"https://api.github.com/users/gjtorikian/gists{/gist_id}","starred_url":"https://api.github.com/users/gjtorikian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gjtorikian/subscriptions","organizations_url":"https://api.github.com/users/gjtorikian/orgs","repos_url":"https://api.github.com/users/gjtorikian/repos","events_url":"https://api.github.com/users/gjtorikian/events{/privacy}","received_events_url":"https://api.github.com/users/gjtorikian/received_events","type":"User","site_admin":true},"created_at":"2015-08-23T17:36:03Z","updated_at":"2015-08-23T17:36:03Z","body":"The only way this is going to work is if you indent three spaces, not four, and continue to use the same backtick notation:\r\n\r\n     * * * ``` ruby\r\n     * * *     if code == 0\r\n     * * *```\r\n\r\nWhere each `*` acts as a space. That way your code blocks are indented, and highlighted.\r\n\r\nIndenting in four triggers the codeblock automatically, and there's no way to specify a highlighting language for these kinds of blocks (from the original Markdown spec). GitHub Flavored Markdown invented the triple-backtick, I believe.\r\n\r\nWe're discussing moving to a more formal standard like [CommonMark](http://commonmark.org/). Realistically, we won't be introducing any more changes to the Markdown spec on our own. Sorry for any trouble this may cause."}}