Skip to content

Commit 91111f8

Browse files
committed
Fix wrong theme usage
1 parent c33c6b5 commit 91111f8

File tree

4 files changed

+9
-4
lines changed

4 files changed

+9
-4
lines changed

.changeset/tasty-coats-destroy.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@code-hike/lighter": patch
3+
---
4+
5+
Fix wrong theme usage

lib/dist/index.cjs.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/dist/index.esm.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2514,10 +2514,10 @@ function highlight(code, alias, themeOrThemeName) {
25142514
if (!theme) {
25152515
throw new UnknownThemeError(themeOrThemeName);
25162516
}
2517-
registry.setTheme(theme);
25182517
return [4 /*yield*/, grammarsPromise];
25192518
case 2:
25202519
grammar = (_a.sent());
2520+
registry.setTheme(theme);
25212521
colorMap = registry.getColorMap();
25222522
return [2 /*return*/, __assign({ lines: tokenize(code, grammar, colorMap), lang: langData.id }, getThemeColors(theme))];
25232523
}

lib/src/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ export async function highlight(
4848
throw new UnknownThemeError(themeOrThemeName as string);
4949
}
5050

51-
registry.setTheme(theme);
52-
5351
const grammar = (await grammarsPromise)!;
52+
53+
registry.setTheme(theme);
5454
const colorMap = registry.getColorMap();
5555

5656
return {

0 commit comments

Comments
 (0)