{"record":{"id":"c148c2a68d89c3dc","repo":"withastro/astro","slug":"astro-markdown-remarkplugins-markdown-rehype","errorCode":null,"errorMessage":"[astro] `markdown.remarkPlugins`, `markdown.rehypePlugins`, and `markdown.remarkRehype` are deprecated. Pass them to `unified({...})` from `@astrojs/markdown-remark` directly instead.","messagePattern":"\\[astro\\] `markdown\\.remarkPlugins`, `markdown\\.rehypePlugins`, and `markdown\\.remarkRehype` are deprecated\\. Pass them to `unified\\((.+?)\\)` from `@astrojs/markdown-remark` directly instead\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/astro/src/core/config/validate.ts","lineNumber":108,"sourceCode":"\t\tconst target = (current ?? (md.processor = unified())) as ReturnType<typeof unified>;\n\t\tconst counts = migratedLegacyPluginCounts.get(target.options) ?? { remark: 0, rehype: 0 };\n\t\t// Only push entries past what we've already folded; mergeConfig appends, so they sit at the tail.\n\t\tif (remarkPlugins.length > counts.remark) {\n\t\t\ttarget.options.remarkPlugins.push(...remarkPlugins.slice(counts.remark));\n\t\t}\n\t\tif (rehypePlugins.length > counts.rehype) {\n\t\t\ttarget.options.rehypePlugins.push(...rehypePlugins.slice(counts.rehype));\n\t\t}\n\t\t// `remarkRehype` is an object, so Object.assign is idempotent for unchanged keys\n\t\t// and absorbs any new keys integrations add.\n\t\tObject.assign(target.options.remarkRehype, remarkRehype);\n\t\tmigratedLegacyPluginCounts.set(target.options, {\n\t\t\tremark: remarkPlugins.length,\n\t\t\trehype: rehypePlugins.length,\n\t\t});\n\t\tif (!didWarnAboutLegacyMarkdownPlugins) {\n\t\t\tdidWarnAboutLegacyMarkdownPlugins = true;\n\t\t\tconsole.warn(\n\t\t\t\t'[astro] `markdown.remarkPlugins`, `markdown.rehypePlugins`, and `markdown.remarkRehype` are deprecated. Pass them to `unified({...})` from `@astrojs/markdown-remark` directly instead.',\n\t\t\t);\n\t\t}\n\t} else if (!didWarnAboutProcessorMismatch) {\n\t\t// Third-party processors can't run remark/rehype plugins. And if they can, they should be passed directly to the processor (like it is for unified) instead of the legacy keys, so we warn either way.\n\t\tdidWarnAboutProcessorMismatch = true;\n\t\tconsole.warn(\n\t\t\t`[astro] \\`markdown.remarkPlugins\\`/\\`rehypePlugins\\`/\\`remarkRehype\\` are set, but your ` +\n\t\t\t\t`\\`${current.name}\\` processor doesn't run them. Move them to \\`unified({...})\\` from ` +\n\t\t\t\t'`@astrojs/markdown-remark` and set `markdown.processor: unified({...})` if you want ' +\n\t\t\t\t'them to apply.',\n\t\t);\n\t}\n}\n\n/**\n * Used twice:\n * - To validate the user config","sourceCodeStart":90,"sourceCodeEnd":126,"githubUrl":"https://github.com/withastro/astro/blob/52e6c34790cc8ac4e69e6135ace06049867e5c4a/packages/astro/src/core/config/validate.ts#L90-L126","documentation":"markdown.remarkPlugins, markdown.rehypePlugins, and markdown.remarkRehype are deprecated in favor of passing them to the unified({...}) processor from @astrojs/markdown-remark. While the unified processor is active, Astro still folds the legacy keys into it (plugins keep working, migration counts tracked per processor object) and prints this one-time warning.","triggerScenarios":"The config (or an integration via updateConfig) sets any of markdown.remarkPlugins / markdown.rehypePlugins / markdown.remarkRehype while using the default unified processor; new integrations injecting plugins through the legacy keys re-trigger the fold each validate pass.","commonSituations":"Any pre-upgrade Astro project with remark/rehype plugins; popular integrations (e.g. MDX-related or documentation tooling) that still push into the legacy keys.","solutions":["Replace the three keys with markdown: { processor: unified({ remarkPlugins: [...], rehypePlugins: [...], remarkRehype: {...} }) }","Update third-party integrations that still write to the legacy keys","Optionally leave them temporarily — behavior is preserved until the keys are removed in a future major"],"exampleFix":"// before\nexport default defineConfig({\n  markdown: {\n    remarkPlugins: [remarkToc],\n    rehypePlugins: [rehypeSlug],\n    remarkRehype: { clobberPrefix: 'user-content-' },\n  },\n});\n\n// after\nimport { unified } from '@astrojs/markdown-remark';\nexport default defineConfig({\n  markdown: {\n    processor: unified({\n      remarkPlugins: [remarkToc],\n      rehypePlugins: [rehypeSlug],\n      remarkRehype: { clobberPrefix: 'user-content-' },\n    }),\n  },\n});","handlingStrategy":"validation","validationCode":"// fail CI when legacy markdown plugin keys are set\nconst legacy = ['remarkPlugins', 'rehypePlugins', 'remarkRehype'];\nconst present = legacy.filter((k) => config.markdown?.[k] !== undefined);\nif (present.length) throw new Error(`Move to processor config: ${present.join(', ')}`);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pass remark/rehype plugins to unified({...}) directly from the start","Audit integrations that inject markdown plugins after upgrading Astro","Run a rendered-output snapshot test after migrating plugin config"],"tags":["markdown","deprecation","plugins","unified"],"backgroundTag":"deprecated-config-option","analyzedSha":"52e6c34790cc8ac4e69e6135ace06049867e5c4a","analyzedAt":"2026-08-18T18:48:03.901Z","contentChangedAt":"2026-08-18T18:48:03.901Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}