5

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" );
$(div1).hide();
}

$(function () {
esconder();
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" );
        $(d1).hide();
    }else{
        esconder();
        $(d).slideDown( "slow" );
        $(d1).show();
    }
});
}
}
});

Code block in quote block on Code Review:

quote-code-block-cr

Code block in quote block on Stack Overflow:

quote-code-block-so

You must log in to answer this question.

Browse other questions tagged .