# 长代码块没有高亮显示

**URL:** https://meta.discourse.org/t/long-code-blocks-get-no-higlighting/206537
**Category:** UX
**Created:** [2021年十月20日 11:17 UTC](https://meta.discourse.org/t/long-code-blocks-get-no-higlighting/206537 "2021-10-20T11:17:54Z")
**Posts on this page:** 1
**Showing post:** 2

<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: [2021年十月20日 17:26 UTC](https://meta.discourse.org/t/long-code-blocks-get-no-higlighting/206537/2 "2021-10-20T17:26:33Z")

</div>

此处已添加限制：

> <https://github.com/discourse/discourse/pull/10125>

我们曾尝试将 highlight 移至专用工作进程（并因此使用后台线程），但在 CORS 方面遇到了一些问题。

如果您想解除该限制，一个可行的方法是参考此 PR：

> <https://github.com/discourse/discourse/commit/d09f283e911c0847ca23372aceefc344526690d2>
>
> Syntax highlighting is a CPU-intensive process which we run a lot while renderin…g posts and while using the composer preview. Moving it to a background worker releases the main thread to the browser, which makes the UX much smoother.

并尝试修复其中存在的 CORS 问题，该问题曾导致此提交被回退。

---

_[View the full topic](https://meta.discourse.org/t/long-code-blocks-get-no-higlighting/206537)._
