Fenced code block is formatting part of it with italics

Hi there, this bug is on Discourse 3.1.0.beta2 (def4133d59), and I also repeated the same bug on another Discourse forum that I don’t control. But for some reason it doesn’t happen here on Discourse Meta.

The following code block is formatting part of one line with italics:

| Left-aligned | Center-aligned | Right-aligned |
| :---         |     :---:      |          ---: |
| git status   | git status     | git status    |
| git diff     | git diff       | git diff      |

I’m using Firefox 102 ESR on Linux.

The blue “status” is the hint: it’s formatting with your default code language.

Here on meta it’s “text”.

You can fix this by specifying the language with:

```text

on the first fence.

Specifying it as the default “auto” I get:

| Left-aligned | Center-aligned | Right-aligned |
| :---         |     :---:      |          ---: |
| git status   | git status     | git status    |
| git diff     | git diff       | git diff      |

Ah, thanks a lot for explaining that. Changing the default to text looks like the best option for my forum.

However, I would still suggest that monospaced font in code blocks should never be formatted apart from the colors for the language.

It looks weird since the detected language was incorrect.

It would look much better with the right language!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.