ganncamp
(G Ann Campbell)
March 6, 2025, 3:42pm
1
I know a new editor is in the works, but presumably the underlying markdown will be the same, and its interpolation will stay the same, so…
In triple-backtick (```
) code blocks, I’ve noticed that some formatting is improperly applied. Here’s a screenshot from me fixing a user’s post. This is the before:
If I change it to a single-tick block there’s no formatting, as expected (please ignore the Grammarly underline on the left):
Hi @ganncamp . What is the value of the “Default code lang” site setting on that forum?
The auto
lang for this particular code block is detecting the language as markdown
, that’s why:
(lang=auto; my incomplete snippet is detected as ruby)
sonar-scanner … etc etc include=src/**,apps/**,include/**,gui/** -Dsonar=true…
(lang=markdown)
sonar-scanner … etc etc include=src/**,apps/**,include/**,gui/** -Dsonar=true…
(lang=text)
sonar-scanner … etc etc include=src/**,apps/**,include/**,gui/** -Dsonar=true…
(lang=bash)
sonar-scanner … etc etc include=src/**,apps/**,include/**,gui/** -Dsonar=true…
You can change this for every post by changing the default code lang to text
or one post by writing e.g.:
```text
sonar-scanner … etc etc include=src/**,apps/**,include/**,gui/** -Dsonar=true…
```
producing the (lang=text) block above
6 Likes
ganncamp
(G Ann Campbell)
March 7, 2025, 12:34pm
5
But why would formatting ever be applied in a code block?
renato
(Renato Atilio)
March 7, 2025, 12:59pm
6
It’s just syntax highlighting your code, but with the wrong language after HighlightJS “auto-detected” it.
Notice the same doesn’t happen here on Meta unless you explicitly start your code block with ```auto
, because we have “Default code lang” set as text
.
4 Likes