forked from kevadesu/forgejo
Move syntax highlighting to web worker (#11017)
This should eliminate page freezes when loading big files/diff. `highlightBlock` is needed to preserve existing nodes when highlighting and for that, highlight.js needs access to the DOM API so I added a DOM implementation to make it work, which adds around 300kB to the output file size of the lazy-loaded `highlight.js`. Co-authored-by: Lauris BH <lauris@nix.lv>
This commit is contained in:
parent
cc4da79fb6
commit
27e3cddfbe
7 changed files with 83 additions and 17 deletions
|
@ -24,6 +24,13 @@ globals:
|
|||
SimpleMDE: false
|
||||
u2fApi: false
|
||||
|
||||
overrides:
|
||||
- files: ["web_src/**/*.worker.js"]
|
||||
env:
|
||||
worker: true
|
||||
rules:
|
||||
no-restricted-globals: [0]
|
||||
|
||||
rules:
|
||||
arrow-body-style: [0]
|
||||
arrow-parens: [2, always]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue