Skip to content

feat: A native pipeline for content#16149

Open
Princesseuh wants to merge 30 commits into
nextfrom
feat/erika-rust-mdx
Open

feat: A native pipeline for content#16149
Princesseuh wants to merge 30 commits into
nextfrom
feat/erika-rust-mdx

Conversation

@Princesseuh
Copy link
Copy Markdown
Member

@Princesseuh Princesseuh commented Mar 30, 2026

Changes

Implements withastro/roadmap#1364

Testing

Added tests, updated tests that depends on remark behavior to use the unified pipeline

Docs

withastro/docs#13919

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Mar 30, 2026

🦋 Changeset detected

Latest commit: 1f15ab6

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 428 packages
Name Type
@astrojs/internal-helpers Minor
@astrojs/mdx Major
astro Major
@astrojs/markdown-remark Major
@astrojs/markdown-satteri Major
@astrojs/cloudflare Patch
@astrojs/markdoc Patch
@astrojs/netlify Patch
@astrojs/node Patch
@astrojs/preact Patch
@astrojs/react Patch
@astrojs/vercel Patch
@test/astro-cloudflare Patch
@e2e/content-collections Patch
@e2e/csp-server-islands Patch
@e2e/preact-component Patch
@e2e/preact-lazy-component Patch
@e2e/react-component Patch
@e2e/server-islands Patch
@e2e/solid-component Patch
@e2e/svelte-component Patch
@e2e/vue-component Patch
@performance/mdx Patch
@test/astro-assets-prefix Patch
@test/astro-basic Patch
@test/content-with-spaces-in-folder-name Patch
@test/content-collections-base Patch
@test/content-collections-mutation Patch
@test/content-collections Patch
@test/content-intellisense Patch
@test/content-layer-remark-plugins Patch
@test/content-layer Patch
@test/content-ssr-integration Patch
@test/content-static-paths-integration Patch
@test/content Patch
@test/core-image-deletion Patch
@test/core-image-svg Patch
@test/jsx-queue-rendering Patch
@test/partials Patch
@test/server-islands-ssr Patch
@test/slots-preact Patch
@test/slots-react Patch
@test/slots-solid Patch
@test/slots-svelte Patch
@test/slots-vue Patch
@test/special-chars-in-component-imports Patch
@test/tailwindcss Patch
@test/astro-cloudflare-prerender-styles Patch
@test/astro-cloudflare-vite-plugin Patch
@test/content-layer-rendering Patch
@test/mdx-css-head-mdx Patch
@test/image-remark-imgattr Patch
@test/mdx-astro-container-escape Patch
@test/mdx-frontmatter-injection Patch
astro-benchmark Patch
@e2e/astro-linked-lib Patch
@e2e/actions-blog Patch
@e2e/actions-react-19 Patch
@e2e/astro-component Patch
@e2e/astro-envs Patch
@e2e/astro-island-hydration-error Patch
@test/astro-cloudflare-node-prerender-mdx Patch
@e2e/css Patch
@test/custom-client-directives Patch
@e2e/dev-toolbar Patch
@e2e/error-cyclic Patch
@e2e/error-sass Patch
@e2e/errors Patch
@e2e/hmr Patch
@e2e/hydration-race Patch
@e2e/i18n Patch
@test/nested-style-bug-e22e Patch
@e2e/preact-compat-component Patch
@e2e/prefetch Patch
@e2e/server-islands-key Patch
@e2e/solid-circular Patch
@e2e/solid-recurse Patch
@e2e/e2e-tailwindcss Patch
@e2e/ts-resolution Patch
@e2e/view-transitions Patch
@e2e/vite-virtual-modules Patch
@performance/md Patch
@performance/mdoc Patch
@test/0-css Patch
fake-astro-library Patch
@test/actions Patch
@test/alias-path-alias-style Patch
@test/ts-paths-no-baseurl Patch
@test/aliases-tsconfig Patch
@test/aliases Patch
@test/api-routes Patch
@test/asset-query-params-chunks Patch
@test/asset-url-base Patch
@test/astro-pages Patch
@test/astro-assets Patch
@test/astro-check-errors Patch
@test/astro-check-no-errors Patch
@test/astro-check-watch Patch
@test/astro-children Patch
@test/astro-client-only Patch
@test/astro-component-bundling Patch
@test/astro-component-code Patch
@test/astro-cookies Patch
@test/astro-css-bundling Patch
@test/astro-dev-headers Patch
@test/astro-dev-http2 Patch
@test/astro-directives Patch
@test/astro-doctype Patch
@test/astro-dynamic Patch
@test/astro-env-content-collections Patch
@test/astro-env-required-public Patch
@test/astro-env-server-fail Patch
@test/astro-env-server-secret Patch
@test/astro-env Patch
@test/astro-envs Patch
@test/astro-expr Patch
@test/astro-get-static-paths Patch
@test/astro-head Patch
@test/astro-jsx Patch
@test/astro-manifest-client-script Patch
@test/astro-manifest-invalid Patch
@test/astro-manifest Patch
@test/astro-markdown-frontmatter-injection Patch
@test/astro-markdown-plugins Patch
@test/astro-markdown-remarkRehype Patch
@test/astro-markdown-skiki-default-color Patch
@test/astro-markdown-skiki-langs Patch
@test/astro-markdown-skiki-themes-custom Patch
@test/astro-markdown-skiki-themes-integrated Patch
@test/astro-markdown-skiki-wrap-false Patch
@test/astro-markdown-skiki-wrap-null Patch
@test/astro-markdown-skiki-wrap-true Patch
@test/astro-markdown-url Patch
@test/astro-markdown Patch
@test/astro-mode Patch
@test/astro-not-response Patch
@test/astro-page-directory-url Patch
@test/astro-partial-html Patch
@test/astro-preview-allowed-hosts Patch
@test/astro-preview-headers Patch
@test/astro-public Patch
@test/astro-script-template-dedup Patch
@test/astro-scripts Patch
@test/astro-slots-nested Patch
@test/astro-slots Patch
@test/concurrency Patch
@test/build-readonly-file Patch
@test/cache-memory-query-include Patch
@test/cache-memory-query Patch
@test/cache-memory Patch
@test/cache-route Patch
@test/client-address-node Patch
@test/client-address Patch
@test/code-component Patch
@test/component-library Patch
@test/config-vite-css-target Patch
@test/config-vite Patch
@test/react-container Patch
@test/content-collection-picture-render Patch
@example/content-collection-references Patch
@test/content-collection-tla-svg Patch
@test/content-collections-empty-dir Patch
@test/content-collections-empty-md-file Patch
@test/content-collections-number-id Patch
@test/content-collections-type-inference Patch
@test/content-collections-with-config-mjs Patch
@test/content-frontmatter Patch
@test/content-layer-loader-schema-function Patch
@test/core-image-data-url Patch
@test/core-image-deletion-ssr Patch
@test/core-image-errors Patch
@test/core-image-fs-config Patch
@test/core-image-remark-infersize Patch
@test/core-image-layout Patch
@test/core-image-picture-emit-file Patch
@test/core-image-remark-imgattr Patch
@test/core-image-ssg Patch
@test/core-image-ssr Patch
@test/core-image-svg-in-client Patch
@test/core-image-unconventional-settings Patch
@test/core-image Patch
@test/csp-adapter Patch
@test/csp-fonts Patch
@test/csp Patch
@test/css-assets Patch
@test/css-dangling-references Patch
@test/css-deduplication Patch
@test/css-double-bundle Patch
@test/css-dynamic-import-dev Patch
@test/css-import-as-inline Patch
@test/css-inline-stylesheets Patch
@test/css-no-code-split Patch
@test/custom-404-injected-from-dep Patch
@test/custom-404-pkg Patch
@test/custom-500-failing Patch
@test/custom-500 Patch
custom-fetch-error-pages Patch
@test/custom-renderer Patch
@test/data-collections-schema Patch
@test/data-collections Patch
@test/debug-component Patch
@test/dev-container Patch
@test/dev-render Patch
@test/dev-request-url Patch
@test/dynamic-endpoint-collision Patch
@test/dynamic-route-build-file Patch
@test/endpoint-routing Patch
@test/error-bad-js Patch
@test/error-build-location Patch
@test/error-non-error Patch
@test/extension-matching Patch
@test/fetch Patch
@test/fonts Patch
@test/astro-fontsource-package Patch
@test/get-static-paths-pages Patch
@test/glob-pages-css Patch
@test/head-propagation-prerender-env Patch
@test/hmr-markdown Patch
@test/hmr-new-page Patch
@test/hmr-slots-render Patch
@test/hoisted-imports Patch
@test/html-component Patch
@test/html-escape Patch
@test/html-page Patch
@test/html-slots Patch
@test/hydration-race Patch
@test/i18n-css-leak-basic Patch
@test/import-ts-with-js Patch
@test/impostor-md-file Patch
@test/integration-add-page-extension Patch
@test/integration-server-setup Patch
@test/large-array-solid Patch
@test/legacy-collections-backwards-compat Patch
@test/lightningcss-scoped-nesting Patch
@test/live-loaders Patch
@test/markdown Patch
@test/middleware-dev Patch
@test/middleware-full-ssr Patch
@test/middleware-no-user-middlewaqre Patch
@test/middleware-sequence-rewrite Patch
@test/middleware-tailwind Patch
@test/minification-html-jsx Patch
@test/minification-html Patch
@test/non-ascii-path Patch
@test/non-html-pages Patch
@test/page-format Patch
@test/page-level-styles Patch
@test/parallel-components Patch
@test/partials-css-boundary Patch
@test/passthrough-image-service Patch
@test/postcss Patch
@test/preact-compat-component Patch
@test/preact-component Patch
@test/queue-rendering Patch
@test/remote-css Patch
@test/request-signal Patch
@test/reuse-injected-entrypoint Patch
@test/rewrite-runtime-error-custom500 Patch
@test/rewrite-runtime-error Patch
@test/reroute-server Patch
@test/rewrite-trailing-slash-never Patch
@test/rewrite-with-base Patch
@test/root-srcdir-css Patch
@test/scoped-style-strategy Patch
@test/server-entry-fake-adapter Patch
@test/server-entry Patch
@test/server-islands-hybrid Patch
@test/sessions Patch
@test/solid-component Patch
@test/sourcemap Patch
@test/space-in-folder-name Patch
@test/ssr-api-route Patch
@test/ssr-assets Patch
@test/ssr-dynamic Patch
@test/ssr-partytown Patch
@test/ssr-prerender-get-static-paths Patch
@test/ssr-prerender Patch
@test/ssr-preview Patch
@test/ssr-renderers-static-vue Patch
@test/ssr-request Patch
@test/ssr-hoisted-script Patch
@test/ssr-scripts Patch
@test/static-build-code-component Patch
@test/static-build-dir Patch
@test/static-build-frameworks Patch
@test/static-build-page-url-format Patch
@test/static-build-ssr Patch
@test/static-build Patch
@test/static-redirect Patch
@test/streaming Patch
@test/svelte-component Patch
@test/svg-deduplication Patch
@e2e/third-party-astro Patch
@test/url-import-suffix Patch
@test/view-transitions Patch
@test/virtual-astro-file Patch
@test/vitest Patch
@test/vue-component Patch
@test/vue-with-multi-renderer Patch
@test/db-aliases Patch
@test/db-db-in-src Patch
@test/error-handling Patch
@test/db-integration-only Patch
@test/db-integration Patch
@test/db-libsql-remote Patch
@test/db-local-prod Patch
@test/db-no-apptoken Patch
@test/db-no-seed Patch
@test/recipes Patch
@test/db-static-remote Patch
@test/alpinejs-basics Patch
@test/alpinejs-directive Patch
@test/alpinejs-plugin-script-import Patch
@test/astro-cloudflare-allowed-hosts Patch
@test/astro-cloudflare-astro-dev-platform Patch
@test/astro-cloudflare-astro-env Patch
@test/astro-cloudflare-binding-image-service Patch
@test/astro-cloudflare-cache-provider-wait-until Patch
@test/astro-cloudflare-client-address Patch
@test/astro-cloudflare-compile-image-service Patch
@test/astro-cloudflare-custom-entryfile Patch
@test/astro-cloudflare-dev-image-endpoint Patch
@test/cloudflare-dev-ssr-optimization Patch
@test/astro-cloudflare-external-image-service Patch
@test/astro-cloudflare-external-redirects Patch
@test/astro-cloudflare-internal-redirects Patch
@test/astro-cloudflare-no-output Patch
@test/astro-cloudflare-prerender-node-env Patch
@test/astro-cloudflare-prerender-queue-consumers Patch
@test/astro-cloudflare-prerenderer-errors Patch
@test/routing-priority-cloudflare Patch
@test/cf-server-entry Patch
@test/astro-cloudflare-server-island-prerender-framework Patch
@test/astro-cloudflare-sessions Patch
@test/astro-cloudflare-sql-import Patch
@test/cf-ssr-deps Patch
@test/astro-cloudflare-static Patch
@test/astro-cloudflare-svelte-rune-deps Patch
@test/astro-cloudflare-top-level-return Patch
@test/astro-cloudflare-with-base Patch
@test/astro-cloudflare-with-react Patch
@test/astro-cloudflare-with-solid-js Patch
@test/astro-cloudflare-with-svelte Patch
@test/astro-cloudflare-with-vue Patch
@test/astro-cloudflare-wrangler-preview-platform Patch
@test/markdoc-content-collections Patch
@test/content-layer-markdoc Patch
@test/headings-custom Patch
@test/headings Patch
@test/image-assets-custom Patch
@test/image-assets Patch
@test/markdoc-propagated-assets Patch
@test/markdoc-render-with-space Patch
@test/markdoc-render-html Patch
@test/markdoc-render-null Patch
@test/markdoc-render-partials Patch
@test/markdoc-render-simple Patch
@test/markdoc-render-table-attrs Patch
@test/markdoc-render-typographer Patch
@test/markdoc-render-with-components Patch
@test/markdoc-render-with-config Patch
@test/markdoc-render-with-extends-components Patch
@test/markdoc-render-with-indented-components Patch
@test/markdoc-render-with-transform Patch
@test/markdoc-variables Patch
@test/netlify-session Patch
@test/netlify-skew-protection Patch
@test/netlify-hosted-astro-project Patch
@test/nodejs-api-route Patch
@test/nodejs-badurls Patch
@test/nodejs-encoded Patch
@test/nodejs-errors Patch
@test/nodejs-headers Patch
@test/nodejs-image Patch
@test/locals Patch
@test/node-middleware Patch
@test/nodejs-prerender-404-500 Patch
@test/nodejs-prerender Patch
@test/nodejs-prerendered-error-page-fetch Patch
@test/nodejs-preview-headers Patch
@test/redirects Patch
@test/node-sessions Patch
@test/ssr-assets-middleware Patch
@test/node-static-headers Patch
@test/node-trailingslash Patch
@test/url Patch
@test/well-known-locations Patch
@test/react-component Patch
@test/sitemap-chunks Patch
@test/sitemap-dynamic Patch
@test/sitemap-i18n-fallback Patch
@test/sitemap-ssr Patch
@test/sitemap-static Patch
@test/sitemap-trailing-slash Patch
async-rendering Patch
conditional-rendering Patch
@test/empty-class Patch
svelte-prop-types Patch
@test/astro-vercel-basic Patch
@test/astro-vercel-image Patch
@test/astro-vercel-integration-assets Patch
@test/vercel-isr Patch
@test/vercel-max-duration Patch
@test/vercel-edge-middleware-with-edge-file Patch
@test/vercel-edge-middleware-without-edge-file Patch
@test/astro-vercel-no-output Patch
@test/astro-vercel-prerendered-error-pages Patch
@test/astro-vercel-redirects-serverless Patch
@test/astro-vercel-redirects Patch
@test/vercel-server-islands Patch
@test/astro-vercel-serverless-prerender Patch
@test/astro-vercel-serverless-with-dynamic-routes Patch
@test/astro-vercel-static-assets Patch
@test/vercel-static-headers Patch
@test/astro-vercel-static Patch
@test/vercel-streaming Patch
@test/astro-vercel-with-web-analytics-enabled-output-as-static Patch
vercel-hosted-astro-project Patch
@test/vue-app-entrypoint-async Patch
@test/vue-app-entrypoint-css Patch
@test/vue-app-entrypoint-no-export-default Patch
@test/vue-app-entrypoint-relative Patch
@test/vue-app-entrypoint-src-absolute Patch
@test/vue-app-entrypoint Patch
@test/vue-basics Patch
vue-prop-types Patch
@benchmark/adapter Major
@benchmark/timer Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions Bot added feat: markdown Related to Markdown (scope) pkg: integration Related to any renderer integration (scope) labels Mar 30, 2026
@Princesseuh Princesseuh changed the title feat(mdx): Rust MDX feat: Try a native pipeline for content Mar 30, 2026
@Princesseuh Princesseuh added pr preview Apply this label to a PR to generate a preview release and removed pr preview Apply this label to a PR to generate a preview release labels Mar 30, 2026
@github-actions github-actions Bot removed the pr preview Apply this label to a PR to generate a preview release label Mar 30, 2026
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Mar 30, 2026

npm i https://pkg.pr.new/astro@16149
npm i https://pkg.pr.new/@astrojs/mdx@16149
npm i https://pkg.pr.new/@astrojs/markdown-remark@16149

commit: a9ca5d7

@github-actions github-actions Bot removed the feat: markdown Related to Markdown (scope) label Apr 3, 2026
@Princesseuh Princesseuh added the pr preview Apply this label to a PR to generate a preview release label Apr 3, 2026
@github-actions github-actions Bot removed the pr preview Apply this label to a PR to generate a preview release label Apr 3, 2026
@Princesseuh Princesseuh added the pr preview Apply this label to a PR to generate a preview release label Apr 3, 2026
@github-actions github-actions Bot removed the pr preview Apply this label to a PR to generate a preview release label Apr 3, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 15, 2026

📊 Dependency Size Changes

Warning

This PR adds 5.8 MB of new dependencies, which exceeds the threshold of 100 kB.

📦 Package 📏 Size
@bruits/satteri-linux-x64-gnu@0.6.3 3.1 MB
@emnapi/core@1.9.1 1.9 MB
@emnapi/runtime@1.9.1 424.1 kB
@emnapi/wasi-threads@1.2.0 227.6 kB
satteri@0.6.3 218.5 kB

Total size change: 5.8 MB

@github-actions github-actions Bot added feat: markdown Related to Markdown (scope) pkg: astro Related to the core `astro` package (scope) docs pr labels Apr 16, 2026
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Apr 16, 2026

Merging this PR will not alter performance

✅ 15 untouched benchmarks
⏩ 3 skipped benchmarks1


Comparing feat/erika-rust-mdx (a9ca5d7) with main (5120ecd)2

Open in CodSpeed

Footnotes

  1. 3 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

  2. No successful run was found on main (f99f32a) during the generation of this report, so 5120ecd was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@Princesseuh Princesseuh added the pr preview Apply this label to a PR to generate a preview release label Apr 16, 2026
@github-actions github-actions Bot removed the pr preview Apply this label to a PR to generate a preview release label Apr 16, 2026
@Princesseuh Princesseuh added pr preview Apply this label to a PR to generate a preview release and removed pr preview Apply this label to a PR to generate a preview release labels Apr 28, 2026
@github-actions github-actions Bot removed the pr preview Apply this label to a PR to generate a preview release label Apr 28, 2026
@Princesseuh Princesseuh force-pushed the feat/erika-rust-mdx branch from a9ca5d7 to bcce353 Compare May 12, 2026 00:35
@github-actions github-actions Bot added pkg: svelte Related to Svelte (scope) pkg: vue Related to Vue (scope) labels May 12, 2026
@Princesseuh Princesseuh changed the title feat: Try a native pipeline for content feat: A native pipeline for content May 21, 2026
@@ -0,0 +1,86 @@
import yaml from 'js-yaml';
Copy link
Copy Markdown
Member Author

@Princesseuh Princesseuh May 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't want to change this (this is not a new file) in case not doing it this way would ripple through a million files, but some (Sätteri) Markdown processors can return both the frontmatter and the content in one very fast call, so extracting it like that is inefficient.

Comment on lines +17 to +18
const firstPos = 'position' in first ? first.position : undefined;
const lastPos = 'position' in last ? last.position : undefined;
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems unrelated at first glance, but our Vite plugin for .html imports use rehype, so global augmentation to the hast module by Sätteri and Rehype ripples here.

markdown: {
syntaxHighlight: false,
// Keep straight quotes so assertions can match `import.meta.env` output literally
processor: satteri({ features: { smartPunctuation: false } }),
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sätteri's smartypants implementation is better than the popular remark plugin, this caused the test to fail because it expected quotes to stay straight, see https://satteri.bruits.org/docs/divergences/#smart-punctuation-pairing-across-nodes

Comment on lines +87 to +94
// Coerce element/null to boolean before asserting — assert.equal on a raw
// linkedom Element vs null pulls util.inspect through the DOM's circular
// refs and can take down the test process on failure.
assert.equal(
selectRemarkExample(document) !== null,
true,
'MDX remark plugins not applied.',
);
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the thing that I wasted a day chasing a memory leak for, if the previous test failed, it would instantly take 25gb of RAM and crash everything. This form avoids this problem

while ((match = regex.exec(html)) !== null) {
const matchKey = ${rawUrl} + '_' + occurrenceCounter;
const imageProps = JSON.parse(match[1].replace(/"/g, '"').replace(/'/g, "'"));
const imageProps = JSON.parse(match[1].replace(/&(?:#x22|quot);/g, '"').replace(/&(?:#x27|apos);/g, "'"));
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same thing regarding named vs number entities.

@@ -0,0 +1,47 @@
// TODO: This is a workaround around a missing API in Sätteri. The visitor architecture naturally does not provide
Copy link
Copy Markdown
Member Author

@Princesseuh Princesseuh May 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will be gone before the actual release, it's not a bug or anything, just haven't decided of an API shape for this usecase yet.

@@ -0,0 +1,158 @@
import type * as hast from 'hast';
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I moved all the processor-agnostic Markdown stuff into this package, because it was the common point of import between everything (and cannot live in Astro itself, recursive deps and all that). I don't think it's a problem, but we could also have some sort of @astrojs/internal-markdown dedicated to this, but I didn't see the point.


The top-level `markdown.remarkPlugins`, `markdown.rehypePlugins`, and `markdown.remarkRehype` options are deprecated. They'll continue to work when `@astrojs/markdown-remark` is installed for now, but this will be removed in the next major.

The top-level `markdown.gfm` and `markdown.smartypants` options are also deprecated. Move them onto your processor instead — `satteri({ features: { gfm: false, smartPunctuation: false } })`, or `unified({ gfm: false, smartypants: false })`:
Copy link
Copy Markdown
Member Author

@Princesseuh Princesseuh May 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In theory, those two options could be fully removed and we could ask users to manually install the Remark plugins, but I figured for a better migration story right now we can just support them in the processor itself.

It's not relevant for Sätteri because it's supported natively there.

@Princesseuh Princesseuh marked this pull request as ready for review May 21, 2026 10:58
@github-actions github-actions Bot added pkg: vue Related to Vue (scope) pkg: solid Related to Solid (scope) labels May 21, 2026
Comment thread pnpm-workspace.yaml Outdated
Comment thread packages/internal-helpers/package.json

export default defineConfig({
markdown: { processor: satteri() },
integrations: [mdx({ processor: unified({ remarkPlugins: [/* ... */] }) })],
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only thing a little weird here, if you wanted to use unified for both, would that mean you'd do:

import { defineConfig, satteri } from 'astro/config';
import mdx from '@astrojs/mdx';
import { unified } from '@astrojs/markdown-remark';

export default defineConfig({
  markdown: { processor: unified({ remarkPlugins: [/* ... */] }) },
  integrations: [mdx({ processor: unified({ remarkPlugins: [/* ... */] }) })],
});

Or would you keep the processor in a variable and reference it in both places? Do they need to share state?

Copy link
Copy Markdown
Member Author

@Princesseuh Princesseuh May 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it's the same as the current options, MDX inherits the options from markdown by default: https://docs.astro.build/en/guides/integrations-guide/mdx/#extendmarkdownconfig

It's a weird behavior of MDX in my opinion... but in line with what we currently have, at least. They don't need to share state, the things that could be shared are always module-level (e.g. Shiki)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs pr feat: markdown Related to Markdown (scope) pkg: astro Related to the core `astro` package (scope) pkg: integration Related to any renderer integration (scope) pkg: solid Related to Solid (scope) pkg: vue Related to Vue (scope) semver: major Change triggers a `major` release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants