summaryrefslogtreecommitdiff
path: root/packages/markdown/remark/src
diff options
context:
space:
mode:
authorGravatar Bjorn Lu <bjornlu.dev@gmail.com> 2023-08-21 21:02:30 +0800
committerGravatar GitHub <noreply@github.com> 2023-08-21 21:02:30 +0800
commite79e3779df0ad35253abcdb931d622847d9adb12 (patch)
treeebbd76838d3b715a18011e96f27773814170b8cf /packages/markdown/remark/src
parent15471e6b4fd12381f9a2d1533ca580436d25b53a (diff)
downloadastro-e79e3779df0ad35253abcdb931d622847d9adb12.tar.gz
astro-e79e3779df0ad35253abcdb931d622847d9adb12.tar.zst
astro-e79e3779df0ad35253abcdb931d622847d9adb12.zip
Remove pre-shiki v0.14 theme names (#8169)
Diffstat (limited to 'packages/markdown/remark/src')
-rw-r--r--packages/markdown/remark/src/remark-shiki.ts20
1 files changed, 0 insertions, 20 deletions
diff --git a/packages/markdown/remark/src/remark-shiki.ts b/packages/markdown/remark/src/remark-shiki.ts
index 28e362e34..77cbf16c6 100644
--- a/packages/markdown/remark/src/remark-shiki.ts
+++ b/packages/markdown/remark/src/remark-shiki.ts
@@ -10,30 +10,10 @@ import type { ShikiConfig } from './types.js';
*/
const highlighterCacheAsync = new Map<string, Promise<shiki.Highlighter>>();
-// Map of old theme names to new names to preserve compatibility when we upgrade shiki
-const compatThemes: Record<string, string> = {
- 'material-darker': 'material-theme-darker',
- 'material-default': 'material-theme',
- 'material-lighter': 'material-theme-lighter',
- 'material-ocean': 'material-theme-ocean',
- 'material-palenight': 'material-theme-palenight',
-};
-
-const normalizeTheme = (theme: string | shiki.IShikiTheme) => {
- if (typeof theme === 'string') {
- return compatThemes[theme] || theme;
- } else if (compatThemes[theme.name]) {
- return { ...theme, name: compatThemes[theme.name] };
- } else {
- return theme;
- }
-};
-
const remarkShiki = async (
{ langs = [], theme = 'github-dark', wrap = false }: ShikiConfig,
scopedClassName?: string | null
) => {
- theme = normalizeTheme(theme);
const cacheID: string = typeof theme === 'string' ? theme : theme.name;
let highlighterAsync = highlighterCacheAsync.get(cacheID);
if (!highlighterAsync) {