# Unexpected formatting in triple-tick code blocks

**URL:** https://meta.discourse.org/t/unexpected-formatting-in-triple-tick-code-blocks/356101
**Category:** Support
**Created:** [March 6, 2025, 3:42pm UTC](https://meta.discourse.org/t/unexpected-formatting-in-triple-tick-code-blocks/356101 "2025-03-06T15:42:56Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![ganncamp](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ganncamp/32/106199_2.png) [@ganncamp](https://meta.discourse.org/u/ganncamp)
#### Post date: [March 6, 2025, 3:42pm UTC](https://meta.discourse.org/t/unexpected-formatting-in-triple-tick-code-blocks/356101/1 "2025-03-06T15:42:56Z")

</div>

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:

 ![Selection_2253](https://global.discourse-cdn.com/meta/original/4X/2/2/c/22cfa65837e4ecb9f2df690658294bb57ac2883b.png)

If I change it to a single-tick block there’s no formatting, as expected (please ignore the Grammarly underline on the left):

 ![Selection_2254](https://global.discourse-cdn.com/meta/original/4X/b/6/d/b6d2b226dcbc56be3d5d529aa9fbd03cfb70a2e9.png)

---

<div class="post-metadata">

### Author: ![per1234](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/per1234/32/569645_2.png) [@per1234](https://meta.discourse.org/u/per1234)
#### Post date: [March 6, 2025, 4:05pm UTC](https://meta.discourse.org/t/unexpected-formatting-in-triple-tick-code-blocks/356101/2 "2025-03-06T16:05:29Z")

</div>

Hi @ganncamp. What is the value of the “Default code lang” site setting on that forum?

---

<div class="post-metadata">

### Author: ![ganncamp](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ganncamp/32/106199_2.png) [@ganncamp](https://meta.discourse.org/u/ganncamp)
#### Post date: [March 6, 2025, 4:19pm UTC](https://meta.discourse.org/t/unexpected-formatting-in-triple-tick-code-blocks/356101/3 "2025-03-06T16:19:14Z")

</div>

It’s `auto`

---

<div class="post-metadata">

### Author: ![supermathie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/supermathie/32/507518_2.png) [@supermathie](https://meta.discourse.org/u/supermathie)
#### Post date: [March 6, 2025, 8:10pm UTC](https://meta.discourse.org/t/unexpected-formatting-in-triple-tick-code-blocks/356101/4 "2025-03-06T20:10:03Z")

</div>

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)

```auto
sonar-scanner … etc etc include=src/ **,apps/** ,include/ **,gui/** -Dsonar=true…

```

(lang=markdown)

```markdown
sonar-scanner … etc etc include=src/ **,apps/** ,include/ **,gui/** -Dsonar=true…

```

(lang=text)

```plaintext
sonar-scanner … etc etc include=src/ **,apps/** ,include/ **,gui/** -Dsonar=true…

```

(lang=bash)

```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

---

<div class="post-metadata">

### Author: ![ganncamp](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ganncamp/32/106199_2.png) [@ganncamp](https://meta.discourse.org/u/ganncamp)
#### Post date: [March 7, 2025, 12:34pm UTC](https://meta.discourse.org/t/unexpected-formatting-in-triple-tick-code-blocks/356101/5 "2025-03-07T12:34:21Z")

</div>

But why would formatting _ever_ be applied in a code block?

---

<div class="post-metadata">

### Author: ![renato](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/renato/32/383632_2.png) [@renato](https://meta.discourse.org/u/renato)
#### Post date: [March 7, 2025, 12:59pm UTC](https://meta.discourse.org/t/unexpected-formatting-in-triple-tick-code-blocks/356101/6 "2025-03-07T12:59:43Z")

</div>

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`.

---

<div class="post-metadata">

### Author: ![tobiaseigen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tobiaseigen/32/539204_2.png) [@tobiaseigen](https://meta.discourse.org/u/tobiaseigen)
#### Post date: [September 17, 2025, 10:44pm UTC](https://meta.discourse.org/t/unexpected-formatting-in-triple-tick-code-blocks/356101/7 "2025-09-17T22:44:07Z")

</div>


