summaryrefslogtreecommitdiff
path: root/packages/integrations/markdoc/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/integrations/markdoc/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/integrations/markdoc/src')
-rw-r--r--packages/integrations/markdoc/src/extensions/shiki.ts21
1 files changed, 0 insertions, 21 deletions
diff --git a/packages/integrations/markdoc/src/extensions/shiki.ts b/packages/integrations/markdoc/src/extensions/shiki.ts
index a553a6bae..df3e79cf7 100644
--- a/packages/integrations/markdoc/src/extensions/shiki.ts
+++ b/packages/integrations/markdoc/src/extensions/shiki.ts
@@ -5,25 +5,6 @@ import type * as shikiTypes from 'shiki';
import { getHighlighter } from 'shiki';
import type { AstroMarkdocConfig } from '../config.js';
-// 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 | shikiTypes.IShikiTheme) => {
- if (typeof theme === 'string') {
- return compatThemes[theme] || theme;
- } else if (compatThemes[theme.name]) {
- return { ...theme, name: compatThemes[theme.name] };
- } else {
- return theme;
- }
-};
-
const ASTRO_COLOR_REPLACEMENTS = {
'#000001': 'var(--astro-code-color-text)',
'#000002': 'var(--astro-code-color-background)',
@@ -53,8 +34,6 @@ export default async function shiki({
theme = 'github-dark',
wrap = false,
}: ShikiConfig = {}): Promise<AstroMarkdocConfig> {
- theme = normalizeTheme(theme);
-
const cacheID: string = typeof theme === 'string' ? theme : theme.name;
if (!highlighterCache.has(cacheID)) {
highlighterCache.set(