I noticed this issue at forums dot swift dot org (sorry, as a new user I’m not allowed >2 links…), where the default code formatting language is Swift. See this thread in particular.
With three-backticks style code formatting, the Swift highlighting rules do seem to be in effect:
let comparators: [(Int, Int) -> Bool] = [ (<), (<=), (>), (>=) ]
It doesn’t show up properly here; perhaps Swift highlighting was something that the forums dot swift dot org admins had to custom-add to highlight.js.
Anyway, the issue is that if you use the “Preformatted text” icon and use indentation to denote code, the code is formatted according to a different set of highlighting rules:
let comparators: [(Int, Int) -> Bool] = [ (<), (<=), (>), (>=) ]
The exact appearance on this forum is different from what you’d see on forums dot swift dot org. The first example above with red highlights on some of the commas and parens is what you get with “Preformatted text” on forums.swift.org. With ```, you get something that looks like that same line but without the red highlighting. I’m guessing that the red highlighting comes from the JavaScript highlighting grammar?
I don’t know enough about Discourse to identify the specific problem, but my guess is that “Preformatted text” handling is not properly honoring the per-forum default code language setting.
Please holler if you need any additional info.