Code tags don't support blank lines


(Drew) #1

Easy repro. This code should have two empty lines but doesn’t:

TestFunction() {



Discourse syntax:

When posting code on a Discourse forum, it can get really messy without the whitespace included for readability. It supports tabs, spacing, and whatnot, but for some reason it doesn’t allow blank newlines. I’m not sure if this is unintended or not, but it’d be great if text in code tags allowed blank lines to preserve the original formatting. It should allow infinite blank lines as well: there really isn’t an issue of preventable spamming because someone could just put a single character on each line and achieve the same effect.

(Daniela) #2
test() {



I use <pre> your code </pre>

(Gerhard Schlager) #3

You can use Markdown for code blocks.

(Drew) #4

Thanks @Trash @gerhard – I’ll use those then.

I assume the Discourse staff would still want to either fix or remove the code tags though since they do have an issue.

(Régis Hanol) #5