Discourse is evolving
Discourse, the forum software we are using, is quite new and still evolving. Sometimes when we update to a newer version, some of the rules and tricks above change.
If you notice any problems, please let us know so we can update things!
What are the new rules for code blocks ?
for instance code with empty lines gets divide into sections ?
if (operation == "sort")return Age(createddate);
date_now = Now();when_created = createddate;
mins = Age(when_created, "n");hours = Age(when_created, "h"); // buggyhours = Abs(mins / 60);days = Age(when_created, "d");weeks = Age(when_created, "w");months = Age(when_created, "m");years = Age(when_created, "yyyy");
Jon
September 6, 2025, 7:45am
2
It looks like you entered it like that deliberately?
If you type it as one block empty lines are no problem.
if (operation == "sort")return Age(createddate);
date_now = Now();when_created = createddate;
mins = Age(when_created, "n");hours = Age(when_created, "h"); // buggyhours = Abs(mins / 60);days = Age(when_created, "d");weeks = Age(when_created, "w");months = Age(when_created, "m");years = Age(when_created, "yyyy");
It was copied & pasted as one chunk. Then selected and then clicked preformatted text.
Discourse has been updated recently - for instance entering posts is different - no previews anymore and shrinking images is different.
Leo
September 6, 2025, 12:48pm
4
That doesn't happen here, FWIW.
Pasted and selected:
Then if I click Preformatted Text, it's turned into a single code block:
Chuck
September 6, 2025, 12:54pm
5
No preview here either on Chrome 140.0.7339.81 (Official Build) (64-bit)
…
if (operation == "sort")return Age(createddate);
date_now = Now();when_created = createddate;
mins = Age(when_created, "n");hours = Age(when_created, "h"); // buggyhours = Abs(mins / 60);days = Age(when_created, "d");weeks = Age(when_created, "w");months = Age(when_created, "m");years = Age(when_created, "yyyy");
…
Edit: No preview and code block does not format
Leo
September 6, 2025, 12:58pm
6
Same Chrome version I am using, so it's probably a browser extension breaking things.
I’m using latest Edge build.
Using
[code]
code here
empty line and more code
[/code]
and
…
code here
empty line and more code
…
does not appear to work either. As per
Script Code
We've configured the forum to show VBScript and JScript code in different colors, to help you tell them apart. This is in addition to the automatic syntax highlighting which Discourse supports.
If you put VBScript or JScript code into blocks, the forum will do a pretty good job of guessing which language you have used and automatically highlighting things.
That said, you can override this for better results, or in situations where you don't want it.
WKen
September 6, 2025, 1:34pm
8
It was closed recently, I opened it manually.
Leo
September 6, 2025, 2:08pm
9
Ah yes, if that toggle is in "rich edit" mode instead of "Markdown", you won’t get a preview and can’t use markdown, and preformatted text doesn’t work properly.
I have no idea why Discourse even added that option, and would remove it if there was a way. I have no idea why they do a lot of things lately.
That has been there for a few months, FWIW, so it's not a recent change.
I've changed the default to Markdown, which should help at least.
1 Like
Chuck
September 6, 2025, 2:15pm
10
That was my issue as well. Thanks for identifying and resolving!