Long code blocks get no higlighting

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

Limit was added here:

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

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

3개의 좋아요

So is Discourse team going to fix it eventually?

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.

3개의 좋아요

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.