# Why isn't HTML code highlighted in codeblocks on meta?

**URL:** https://meta.discourse.org/t/why-isnt-html-code-highlighted-in-codeblocks-on-meta/167033
**Category:** Site feedback
**Created:** [October 12, 2020, 10:33pm UTC](https://meta.discourse.org/t/why-isnt-html-code-highlighted-in-codeblocks-on-meta/167033 "2020-10-12T22:33:25Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)
#### Post date: [October 12, 2020, 10:33pm UTC](https://meta.discourse.org/t/why-isnt-html-code-highlighted-in-codeblocks-on-meta/167033/1 "2020-10-12T22:33:25Z")

</div>

When I create an HTML codeblock, the code isn’t highlighted:

```html
<li><a class="widget-link" href="" title=""><span class="d-label"></span></a></li>

```

![image](https://global.discourse-cdn.com/meta/original/3X/9/5/95818980a41ee84f50120fe5de9fc46a73f2b538.png)

However, it is on my own Discourse forums:

![image](https://global.discourse-cdn.com/meta/original/3X/9/f/9f48bb840b968d346dfdf2cca8ae98fcb98cbcbe.png)

Why is HTML code not properly highlighted here?

---

<div class="post-metadata">

### Author: ![awesomerobot](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/awesomerobot/32/142900_2.png) [@awesomerobot](https://meta.discourse.org/u/awesomerobot)
#### Post date: [October 12, 2020, 10:37pm UTC](https://meta.discourse.org/t/why-isnt-html-code-highlighted-in-codeblocks-on-meta/167033/2 "2020-10-12T22:37:22Z")

</div>

We have the `default code lang` setting set to `text` for some reason I’m unaware of… by default it’s `auto` AND we also don’t have `HTML` in the list for the `highlighted languages` setting for another reason I’m unaware of. Setting the formatting to XML still works.

---

<div class="post-metadata">

### Author: ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)
#### Post date: [October 12, 2020, 10:46pm UTC](https://meta.discourse.org/t/why-isnt-html-code-highlighted-in-codeblocks-on-meta/167033/3 "2020-10-12T22:46:15Z")

</div>

```xml
<li><a class="widget-link" href="" title=""><span class="d-label"></span></a></li>

```

That will do. 👍

---

<div class="post-metadata">

### Author: ![seanblue](https://avatars.discourse-cdn.com/v4/letter/s/dc4da7/32.png) [@seanblue](https://meta.discourse.org/u/seanblue)
#### Post date: [October 13, 2020, 12:22am UTC](https://meta.discourse.org/t/why-isnt-html-code-highlighted-in-codeblocks-on-meta/167033/6 "2020-10-13T00:22:33Z")

</div>

> [@awesomerobot](#):
>
> we also don’t have `HTML` in the list for the `highlighted languages` setting for another reason I’m unaware of.

I’ve run into this before, but C# also doesn’t work.

---

<div class="post-metadata">

### Author: ![pmusaraj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pmusaraj/32/119489_2.png) [@pmusaraj](https://meta.discourse.org/u/pmusaraj)
#### Post date: [February 23, 2023, 8:17pm UTC](https://meta.discourse.org/t/why-isnt-html-code-highlighted-in-codeblocks-on-meta/167033/7 "2023-02-23T20:17:05Z")

</div>

I just merged a fix for this one: [DEV: Add support for aliases in HighlightJS languages (#20380) · discourse/discourse@c052df4 · GitHub](https://github.com/discourse/discourse/commit/c052df412a5cfe4f829a93622480fbbc57b2a308)
