Repository navigation
Commit 43e0fc2
committed
perf(rehype-shiki): give the default themes by name
The default themes were passed as theme objects, which Shiki
normalizes, and parses into a new vscode-textmate theme, on every
highlight, and which keep it from tokenizing in a single pass. They're
registered with the highlighter anyway, so they're now given by name.
The output is the same. Given by name, a theme's own color replacements
no longer apply to the code block's foreground and background, but the
default themes' only replacement (`#616e88`) is neither.
Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>1 parent 12d75e5 commit 43e0fc2
3 files changed
Lines changed: 19 additions & 2 deletions
File tree
- .changeset
- packages/rehype-shiki/src
- __tests__
| 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 | |
|---|---|---|---|
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
90 | | - | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
91 | 94 | | |
92 | 95 | | |
93 | 96 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | | - | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
68 | 77 | | |
69 | 78 | | |
70 | 79 | | |
| |||
0 commit comments