Currently, Stack Exchange’s Markdown parser only allows four-space indents to represent code blocks:
// some code // another line of code
GitHub Flavored Markdown and other Markdown implementations allow for an alternative syntax, that doesn’t require indenting each code line:
``` // some code // another line of code ```
This is much more convenient to type out. It would be super useful if Stack Exchange could support this syntax.
By extension, this syntax also allow you to specify the source language right after the opening
```js // some code // another line of code ```
…which would then enable syntax highlighting for that specific language. Although it’s interesting metadata, I don’t think this feature is needed on Stack Overflow, as the syntax highlighting library works pretty well for various languages.
So, even if you would allow this syntax but ignore the
```language, this would greatly improve my productivity on Stack Exchange.
What do you think?
The moderators are currently collecting feedback regarding this feature, so please post a comment with your thoughts. Good idea? Bad idea? Don’t really care? What do you think are the benefits/drawbacks? Experiences? Let them know! Thanks!
`is a single key where Ctrl+K is not; as a result
click ``` click ```is faster to perform.
Ctrl+V, DownArrow, Hometo indent the entire block.