# Markdown formatting labels for codeblock

**URL:** https://forums.rocket.chat/t/markdown-formatting-labels-for-codeblock/22788
**Category:** Community Support
**Tags:** rocketchat-apps
**Created:** [March 13, 2026, 8:41am UTC](https://forums.rocket.chat/t/markdown-formatting-labels-for-codeblock/22788 "2026-03-13T08:41:02Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![carotin](https://avatars.discourse-cdn.com/v4/letter/c/cc9497/32.png) [@carotin](https://forums.rocket.chat/u/carotin)
#### Post date: [March 13, 2026, 8:41am UTC](https://forums.rocket.chat/t/markdown-formatting-labels-for-codeblock/22788/1 "2026-03-13T08:41:03Z")

</div>

When I am writing a message, I paste a command line as a multiline codeblock, I would like to have it formatted (colorized).

If I paste a json, I can use the following:

````auto
```json
{
   "field": "value"
}
```

````

and it’s highlighted/formatted as JSON document.

But it’s a mess with CLI/shell code. Nothing really works with labels like `shell`, `bash`, `sh` (no formatting applied). Only `powershell` works somehow, but the formatting is broken.

The following code block:

````auto
```shell
curl --request POST \
  --url http://host/path \
  --header 'authorization: Bearer {{bearer_access_token}}' \
  --header 'content-type: application/json' \
  --data '{
  "name": "{{name}}"
}'
```

````

is displayed as regular code block (text with no formatting).

If I specify `powershell` label, then it has some flaws (see the number highlighting in the URL):

 ![image](https://us1.discourse-cdn.com/flex021/uploads/rocketchat/original/2X/f/ff74a800b80a40b8cfa73a6dbe9541462fe58d40.png)

Where is the documentation listing all the possible labels for various supported highlighting formats?

Why `powershell` works, but no general labels like `shell`, `bash`, `sh`?

---

<div class="post-metadata">

### Author: ![reetp](https://sea1.discourse-cdn.com/flex021/user_avatar/forums.rocket.chat/reetp/32/5546_2.png) [@reetp](https://forums.rocket.chat/u/reetp)
#### Post date: [March 13, 2026, 5:20pm UTC](https://forums.rocket.chat/t/markdown-formatting-labels-for-codeblock/22788/2 "2026-03-13T17:20:13Z")

</div>

They use a formatting library but no idea exactly what. You need to read the code.

You should make sure all backticks are on a separate line.

On your post you are putting code on the same line as the backticks. Like:

_Backticks Code_

_Code_

_Code_

_Backticks_

Should be more like this:

_Backticks_

_Code_

_Code_

_Code_

_Backticks_

---

<div class="post-metadata">

### Author: ![carotin](https://avatars.discourse-cdn.com/v4/letter/c/cc9497/32.png) [@carotin](https://forums.rocket.chat/u/carotin)
#### Post date: [March 13, 2026, 6:46pm UTC](https://forums.rocket.chat/t/markdown-formatting-labels-for-codeblock/22788/3 "2026-03-13T18:46:09Z")

</div>

> [@reetp](#):
>
> On your post you are putting code on the same line as the backticks.

In my post opening backticks are followed by “label” I mentioned, that declares the highlighting I want. It’s a standard markdown syntax for code blocks in Stack Overflow ([offical SO docs](https://stackoverflow.com/help/formatting#:~:text=Syntax%20highlighting%20for%20code)) and many many other platforms. I believe it’s been pretty much a standard for a very long time.

Shot from SO docs:

 ![image](https://us1.discourse-cdn.com/flex021/uploads/rocketchat/original/2X/8/841dd322283e21c4932288ee052d6e2140cc4d74.png)

As I can see, SO uses `highlight.js` library that contains “bash” highlighting (see [their GitHub discussion](https://github.com/highlightjs/highlight.js/issues/4036#issue-2230003620) with an example of “backticks with label”). It’s strange that no standard labels for shell code apply for codeblock highlighting in RocketChat.

---

<div class="post-metadata">

### Author: ![reetp](https://sea1.discourse-cdn.com/flex021/user_avatar/forums.rocket.chat/reetp/32/5546_2.png) [@reetp](https://forums.rocket.chat/u/reetp)
#### Post date: [March 13, 2026, 10:48pm UTC](https://forums.rocket.chat/t/markdown-formatting-labels-for-codeblock/22788/4 "2026-03-13T22:48:42Z")

</div>

I can’t recall which lubrary they use. Plese have a read.

If you read the changelogs et al you will see that the format I mentioned with backticks clearly above & below code has been their “standard” for a year or more (search github). It may not accept labels.

It is the way it is.

They don’t necessarily conform to anyone elses standards, be that SO or anyone else.

That is their perogative. They do what suits them.

Of course if you don’t like that you are free to open a PR in the feature requests repo, or to take the source code and build whatever suits you. The power of open source!

---

<div class="post-metadata">

### Author: ![carotin](https://avatars.discourse-cdn.com/v4/letter/c/cc9497/32.png) [@carotin](https://forums.rocket.chat/u/carotin)
#### Post date: [March 15, 2026, 4:04pm UTC](https://forums.rocket.chat/t/markdown-formatting-labels-for-codeblock/22788/5 "2026-03-15T16:04:38Z")

</div>

> [@reetp](#):
>
> …has been their “standard” for a year or more (search github). It may not accept labels.
> 
> It is the way it is.

Then why do these two code blocks have different highlighting?

 ![image](https://us1.discourse-cdn.com/flex021/uploads/rocketchat/original/2X/d/d024fda2bcafb9b0dcf9f3ebd57385e4d3c50b52.png)

The rendered result is in the next message due to the restrictions of the forum (one image per post)

---

<div class="post-metadata">

### Author: ![carotin](https://avatars.discourse-cdn.com/v4/letter/c/cc9497/32.png) [@carotin](https://forums.rocket.chat/u/carotin)
#### Post date: [March 15, 2026, 4:05pm UTC](https://forums.rocket.chat/t/markdown-formatting-labels-for-codeblock/22788/6 "2026-03-15T16:05:16Z")

</div>

![image](https://us1.discourse-cdn.com/flex021/uploads/rocketchat/original/2X/1/15866bf61588ffdb312bdaccd2c0e89c87bc8447.png)

---

<div class="post-metadata">

### Author: ![reetp](https://sea1.discourse-cdn.com/flex021/user_avatar/forums.rocket.chat/reetp/32/5546_2.png) [@reetp](https://forums.rocket.chat/u/reetp)
#### Post date: [March 15, 2026, 6:43pm UTC](https://forums.rocket.chat/t/markdown-formatting-labels-for-codeblock/22788/7 "2026-03-15T18:43:30Z")

</div>

See my previous response 🤷‍♂️

> [@reetp](#):
>
> It is the way it is.

^^^^^^^^^^^^^^^^

> [@reetp](#):
>
> Of course if you don’t like that you are free to open a PR in the feature requests repo, or to take the source code and build whatever suits you. The power of open source!

^^^^^^^^^^^^^^^^
