Line breaks in code blocks don't work without a linebreak above

I have a few code blocks inside lists in my “Importing from phpBB3” topic. They looked fine when I posted this a few days ago. But now, after a small edit with insignificant changes, the line breaks inside the code blocks are gone.

The preview still looks fine:

The actual post however looks wrong:

Is this a regression or is there something wrong with my post?

1 Like

Something’s wrong here. Will have a look.

1 Like

Has already been reported. You need a blank line above or that will happen.

You also really ought to use 4 space indent rather than fenced code blocks when you don’t need syntax highlighting.

1 Like

The strange thing is, it worked when I posted it two weeks ago…

Could be related to @sam’s changes to hack in <table> support, don’t know.

Ok, I changed the way I format the code blocks for now. The thing is, I kinda like the bash syntax highlighting. :wink:

The issue here really is why is the preview different than the cooked post?

4 Likes

I have a hunch on this.

We never correctly

hoisted
code blocks

and this incorrect hoisting, though not impacting the client that uses ember initializers to initialize dialects, did heavily impact the server that uses a different paradigm.

I fixed hoisting and unhoisting… but our architecture needs some TLC here, we need to split off the rendering engine into a cleaner, independent, multisite friendly piece.

https://github.com/discourse/discourse/commit/568adc49c09c4964ef3168dfd1fa12c2fb05203b

3 Likes