I saw some question like this but they seemed to be specific to iPad or Android. This problem happens on the main site as displayed in a regular web browser on a computer.

I took screenshots of the same problem on Code Review and on Stack Overflow. It behaves a bit differently. But both of them broke out of the code block on line 3, which is 310 characters long, and got back into code block formatting after the next occurrence of 2 newline characters.

From there on, it:

  • Code Review: breaks in and out of code block formatting and on each set of 2 newline characters, and it "swallows" single newline characters that are in the code blocks.

  • Stack Overflow: preserves the code block formatting for the rest of the code.

Additional information:

This seems to happen when you use SE's UI code block and quote block buttons/shortcuts. If you manuall do it in HTML with <blockquote><pre><code> it appears to format correctly.

Code block by itself:

function esconder() {
$(div).slideUp( "slow" );

$(function () {
function contar() {
for (i=0; i<27; i++) {
    var d = div[i];
    var d1 = div1[i];
    var b = botao[i];
    var b1 = botao1[i];

$('#b , #b1').click(function() {
    if ($(d, d1).is(":visible")) {
        $(d).slideUp( "slow" );
        $(d).slideDown( "slow" );

Code block in quote block on Code Review:


Code block in quote block on Stack Overflow:


You must log in to answer this question.

Browse other questions tagged .