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


(Gerhard Schlager) #1

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?


(Régis Hanol) #2

Something’s wrong here. Will have a look.


(Jeff Atwood) #3

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.


(Gerhard Schlager) #4

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


(Jeff Atwood) #5

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


(Gerhard Schlager) #6

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


(Régis Hanol) #7

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


(Sam Saffron) #8

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


(Sam Saffron) #9