What is meta? ×
Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 127 Stack Exchange communities.

In my answer http://stackoverflow.com/questions/2214224/auto-fetch-all-youtube-videos-from-account/2220468#2220468 I can't get code formatting to work. What do I do wrong?

Ok, I understand it was still in the list. However, I used two linebreaks between my last listitem and the code. How much linebreaks should I use then?

share|improve this question
1  
Extra four spaces: meta.stackexchange.com/questions/3792/… –  random Feb 8 '10 at 9:20
add comment

2 Answers

up vote 1 down vote accepted

See here

http://stackoverflow.com/editing-help

I recommend avoiding code inside lists, personally, but you need to indent 8 spaces.

share|improve this answer
    
Another note on this... Once you have a list in your answer, if you want to insert code that is not at the list level, you must have at least one non-blank, non-list line before the code (a horizontal rule works well) in order to break out of the "list" logic and allow the code to be formatted correctly. (See o.k.w's answer below, and stackoverflow.com/questions/3096866/… for an example that I just edited.) –  GalacticCowboy Jun 29 '10 at 15:05
add comment

A list:

  • item 1
  • item 2

    function(code-in-a-list){ //with four leading spaces }

The Code: (this line ends the list too)

function(code-outside-a-list){
  //with four leading spaces too
}
share|improve this answer
add comment

You must log in to answer this question.

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