Repository navigation
Commit 36ac193
committed
fix(rehype-shiki): only import every grammar without a highlighter
The plugin imported `index.mjs` statically, and that module imports
every grammar Shiki bundles (`LANGS`) as soon as it's loaded, so a
caller passing its own highlighter still paid for all of them: 260
grammar modules on each thread that loads the plugin. It's now imported
only when the plugin has to create a highlighter itself.
This lets doc-kit, which highlights with a highlighter that loads
grammars on demand, use the plugin rather than a copy of it.
Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>1 parent bbbdde7 commit 36ac193
2 files changed
Lines changed: 14 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | | - | |
9 | 7 | | |
10 | 8 | | |
11 | 9 | | |
| |||
57 | 55 | | |
58 | 56 | | |
59 | 57 | | |
60 | | - | |
61 | | - | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
62 | 67 | | |
63 | 68 | | |
64 | 69 | | |
| |||
0 commit comments