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

Currently, trying to put two code blocks one after the other results in one big code block.

CodeBlock1
{
   // Hey, look at me!
}

CodeBlock2
{
   // I'm different (but not really).
}

How do I separate these blocks without typing anything in between (as shown below)?

CodeBlock1
{
   // Hey, look at me!
}

You shall not pass!

CodeBlock2
{
   // I'm different (but not really).
}
share|improve this question

2 Answers 2

You can use

a html comment
to separate them.

Source:

    a html comment

<!-- tsk -->

    to separate them.
share|improve this answer
    
That works, although I wish a simple newline would do. –  Yawus Oct 23 '12 at 23:18
3  
Well, that's difficult, how many empty lines signal a new code block? People often have a surprisingly large number of consecutive empty lines in their code. –  Daniel Fischer Oct 23 '12 at 23:20

You can't. Markdown doesn't care how many lines you add in between. If there's nothing there, it's still the same code block. That's how Markdown works. If you don't want physical text between them, you can use something that Markdown will remove to make it break the code block thinking there's something there. Most commonly an empty HMTL comment: <!-- -->

CodeBlock1
{
   // Hey, look at me!
}
CodeBlock2
{
   // I'm different (but not really).
}

Since you're using an HTML comment, also consider if your code will be highlighted, and properly. If not, considering using that comment to specify the language so it does get highlighted properly. It will make the post look nicer while achieving your goal at the same time.

share|improve this answer

You must log in to answer this question.

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