Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 157 Stack Exchange communities.

What is meta?
Here's how it works:
  1. Any Stack Exchange user can ask a question
  2. The community provides support, votes on ideas, and reports bugs
  3. Your voice helps shape the way Stack Exchange operates

This question already has an answer here:

I find the 4 space indentation to include code snippets unnecessarily difficult to use. Typically, when you copy and paste some code it requires manually reformatting each line (unless there's some hidden mechanism I'm missing). It's also weird that there's no way to specify what language you're actually showing in your code snippet (meaning the syntax highlighting is kind of a best-guess).

Github and CodePlex both use a system where triple backquotes (```) denote a block of code. IMO, this is much easier to use and requires zero reformatting after copying and pasting. They also allow you to specify the language immediately after the triple backquotes, to give the syntax highlighting a hint of what language you're showing.


``` JavaScript

function(foo) { alert(foo); }


Does anyone else feel this would be preferable to the current system?

P.S. I also think something similar would be better for block quotes, >>> perhaps?

Edit: Sorry if this already has been suggested, searching "triple backquote" yielded nothing.

share|improve this question

marked as duplicate by Tim Stone, Arjan, user7116, Daniel Fischer, Cody Gray Apr 1 '13 at 20:33

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

You can format the code by either clicking on the code sample icon (curly brackets) or pressing ctrl-K. Syntax highlighting can also be specified. – Juhana Apr 1 '13 at 18:54
See also How do I format my code blocks? – Arjan Apr 1 '13 at 18:56

Another thing you can do is select the code (once pasted) and do CTRL + K.

This add 4 spaces of indentation at the beginning of every selected line. Note: It's works as a toggle so if you do it twice it will add then remove the 4 spaces.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged .