Skip to content

Commit 0f78231

Browse files
authored
Merge pull request #2912 from codecrafters-io/fix-shiki-highlighter-warning
Fix a shiki deprecation warning for `getHighlighter`
2 parents 3f5adb1 + 6c36a3c commit 0f78231

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app/utils/highlighter-cache.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import config from 'codecrafters-frontend/config/environment';
22
import * as shiki from 'shiki';
33

44
/**
5-
* getHighlighter() is the most expensive step of Shiki. Instead of calling it on every page,
5+
* createHighlighter() is the most expensive step of Shiki. Instead of calling it on every page,
66
* cache it here as much as possible. Make sure that your highlighters can be cached, state-free.
77
* We make this async, so that multiple calls to parse markdown still share the same highlighter.
88
*/
@@ -35,7 +35,7 @@ export default function getOrCreateCachedHighlighterPromise(
3535
} as unknown as shiki.Highlighter);
3636
});
3737
} else {
38-
highlighterPromise = shiki.getHighlighter(options);
38+
highlighterPromise = shiki.createHighlighter(options);
3939
}
4040

4141
highlighterCacheAsync.set(cacheId, highlighterPromise);

0 commit comments

Comments
 (0)