highlightjs / highlightjs/highlightjs.org

When the highlight code text is too large, it can cause the browser to lag and even crash

Open
#13 12 comments 0 reactions 0 assignees View on GitHub
needs triage
Dominant language
TypeScript
Stars
35
Forks
15
PR merge metrics
No merged PRs in 30d

Description

**Describe the issue/behavior that seems buggy**

When I highlight the code text is too large, causing the browser to crash, open the browser DevTools found that the plugin will be a large number of text into the dom, too much dom caused the browser to crash and crash, please ask me when I need to highlight a large number of code text what should I do to avoid this problem?

**Sample Code or Instructions to Reproduce**

**Expected behavior**

I'm testing this in the demo on the official website by pasting in a lot of code text, and I'm also having this problem, the demo page stutters and I can't do anything with it.
![image](https://github.com/highlightjs/highlight.js/assets/21114634/466b692b-d890-4b97-a02e-6d99db167189)

**Additional context**

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.