5

I would like to display two separate blocks of code with nothing but whitespace in between. It seems that if you separate blocks with multiple line breaks, the Stack code formatter will consolidate them into a single block. I would like these two blocks:

Hello this is code block 1

And this is code block 2

to be formatted like these two blocks:

Hello this is code block 1

.

And this is code block 2

but without the intermediate dot.

1 Answer 1

9

You can insert an HTML comment (<!-- -->) in between:

Block 1
Block 2

This also works with blockquotes:

Block 1

Block 2

3
  • 1
    Also works with just <!-->
    – Cai
    Oct 28, 2016 at 18:26
  • 1
    @Cai: Or, indeed, anything that looks vaguely like an HTML tag but is not on the whitelist. <!> is sufficient. Oct 29, 2016 at 6:37
  • @Cai one minor difference: using <!-- --> renders <pre></pre><pre></pre>, while using <!--> renders <pre></pre><p></p><pre></pre>, which is not as optimal.
    – chharvey
    Oct 12, 2017 at 14:45

You must log in to answer this question.

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