# Long code blocks get no higlighting

**URL:** https://meta.discourse.org/t/long-code-blocks-get-no-higlighting/206537
**Category:** UX
**Created:** [October 20, 2021, 11:17am UTC](https://meta.discourse.org/t/long-code-blocks-get-no-higlighting/206537 "2021-10-20T11:17:54Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![meglio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/meglio/32/71444_2.png) [@meglio](https://meta.discourse.org/u/meglio)
#### Post date: [October 20, 2021, 11:17am UTC](https://meta.discourse.org/t/long-code-blocks-get-no-higlighting/206537/1 "2021-10-20T11:17:54Z")

</div>

I noticed that long code blocks get no highlighting - like e.g. 36k+ symbols or somewhat around that. How can I fix it?

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [October 20, 2021, 5:26pm UTC](https://meta.discourse.org/t/long-code-blocks-get-no-higlighting/206537/2 "2021-10-20T17:26:33Z")

</div>

Limit was added here:

[https://github.com/discourse/discourse/pull/10125](https://github.com/discourse/discourse/pull/10125)

We tried moving highlight to a dedicated worker (and consequently a background thread) but hit some issues around CORS.

If you want to lift the limit a good approach is taking this PR

[https://github.com/discourse/discourse/commit/d09f283e911c0847ca23372aceefc344526690d2](https://github.com/discourse/discourse/commit/d09f283e911c0847ca23372aceefc344526690d2)

and trying to fix the CORS issues it had and made it be reverted.

---

<div class="post-metadata">

### Author: ![meglio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/meglio/32/71444_2.png) [@meglio](https://meta.discourse.org/u/meglio)
#### Post date: [October 20, 2021, 10:01pm UTC](https://meta.discourse.org/t/long-code-blocks-get-no-higlighting/206537/3 "2021-10-20T22:01:19Z")

</div>

So is Discourse team going to fix it eventually?

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [October 20, 2021, 10:29pm UTC](https://meta.discourse.org/t/long-code-blocks-get-no-higlighting/206537/4 "2021-10-20T22:29:52Z")

</div>

It’s not in our roadmap at the moment. While getting the highlight working in a background worker is nice to have, the impact of the limit is low considering how popular code blocks of over 30000 characters are in typical discussions.

---

<div class="post-metadata">

### Author: ![meglio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/meglio/32/71444_2.png) [@meglio](https://meta.discourse.org/u/meglio)
#### Post date: [October 21, 2021, 5:10am UTC](https://meta.discourse.org/t/long-code-blocks-get-no-higlighting/206537/5 "2021-10-21T05:10:16Z")

</div>

Could you please at least expose that 30000 number as a configuration? Possibly in the container .yml file? Or in the Settings? Whatever way would work, I just need to increase that limit.
