Repository navigation
Commit 61e78d9
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 whose tokens can't be cached for both. They're
registered with the highlighter anyway, so they're now given by name,
in a `DEFAULT_THEME_OPTIONS` constant.
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 a07ab77 commit 61e78d9
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 | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
23 | 32 | | |
24 | 33 | | |
25 | 34 | | |
| |||
64 | 73 | | |
65 | 74 | | |
66 | 75 | | |
67 | | - | |
| 76 | + | |
68 | 77 | | |
69 | 78 | | |
70 | 79 | | |
| |||
0 commit comments