diff options
Diffstat (limited to 'packages/markdown/remark/src')
-rw-r--r-- | packages/markdown/remark/src/index.ts | 10 | ||||
-rw-r--r-- | packages/markdown/remark/src/remark-shiki.ts | 20 | ||||
-rw-r--r-- | packages/markdown/remark/src/types.ts | 1 |
3 files changed, 3 insertions, 28 deletions
diff --git a/packages/markdown/remark/src/index.ts b/packages/markdown/remark/src/index.ts index aa02f8ea9..43ab885b6 100644 --- a/packages/markdown/remark/src/index.ts +++ b/packages/markdown/remark/src/index.ts @@ -95,10 +95,8 @@ export async function renderMarkdown( parser.use([remarkPrism(scopedClassName)]); } - if (opts.experimentalAssets) { - // Apply later in case user plugins resolve relative image paths - parser.use([remarkCollectImages]); - } + // Apply later in case user plugins resolve relative image paths + parser.use([remarkCollectImages]); } parser.use([ @@ -116,9 +114,7 @@ export async function renderMarkdown( parser.use([[plugin, pluginOpts]]); }); - if (opts.experimentalAssets) { - parser.use(rehypeImages()); - } + parser.use(rehypeImages()); if (!isPerformanceBenchmark) { parser.use([rehypeHeadingIds]); } 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) { diff --git a/packages/markdown/remark/src/types.ts b/packages/markdown/remark/src/types.ts index 2f2d36de7..6d8ecf8f2 100644 --- a/packages/markdown/remark/src/types.ts +++ b/packages/markdown/remark/src/types.ts @@ -67,7 +67,6 @@ export interface MarkdownRenderingOptions extends AstroMarkdownOptions { }; /** Used for frontmatter injection plugins */ frontmatter?: Record<string, any>; - experimentalAssets?: boolean; } export interface MarkdownHeading { |