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

Possible Duplicate:
Why is a code block not properly formatted when placed immediately after a list item?

The 4 space indent is not being recognized as a code block after a numbered list.

See below for example:

  1. Make waffle batter
  2. Cook for 6 to 8 weeks
  3. Feed to unicorn

    public void EatWaffles(Unicorn unicorn) { if (unicorn.LikesWaffles) { // do something } }

First saw the problem on this SO answer. I forced the code highlighting on that answer using <pre><code>...</code></pre>, but I think this is probably a problem that should be fixed.

share|improve this question

marked as duplicate by John Rudy, YOU, Jon Seigel, Jeff Atwood Apr 21 '10 at 5:11

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 might want to switch the order of those ending tags. Generally it would be </code></pre> –  Tyler Carter Apr 21 '10 at 2:44
    
@Chacha102: Oops! Since I had to add the &lt; and &gt; to make the tags show, I copied and pasted it but forgot to reverse the order. Thanks! –  Zach Johnson Apr 21 '10 at 3:36
add comment

2 Answers 2

Indent your code eight spaces instead of four.

  • I
  • Am
  • a
  • List!

    public class OhLookImAfterAList
    {
        public OhLookImAfterAList()
        {
            Console.WriteLine("Oh Snap!");
        }
    }
    
share|improve this answer
    
Hmmm...I wonder if the code formatting button should be modified to add the 8 spaces if the block is just after a list. –  Zach Johnson Apr 21 '10 at 3:40
add comment

You need to put 8 spaces for that.

share|improve this answer
add comment

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