You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/docs/en/guides/integrations-guide/mdx.mdx
+45-20Lines changed: 45 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -255,16 +255,18 @@ Once the MDX integration is installed, no configuration is necessary to use `.md
255
255
You can configure how your MDX is rendered with the following options:
256
256
257
257
*[Options inherited from Markdown config](#options-inherited-from-markdown-config)
258
+
*[`processor`](#processor)
258
259
*[`extendMarkdownConfig`](#extendmarkdownconfig)
259
260
*[`recmaPlugins`](#recmaplugins)
260
261
*[`optimize`](#optimize)
261
262
262
263
### Options inherited from Markdown config
263
264
264
-
All [`markdown` configuration options](/en/reference/configuration-reference/#markdown-options) can be configured separately in the MDX integration. This includes remark and rehype plugins, syntax highlighting, and more. Options will default to those in your Markdown config ([see the `extendMarkdownConfig` option](#extendmarkdownconfig) to modify this).
265
+
All [`markdown` configuration options](/en/reference/configuration-reference/#markdown-options) can be configured separately in the MDX integration, including the [Markdown processor](#processor), syntax highlighting, and more. Options will default to those in your Markdown config ([see the `extendMarkdownConfig` option](#extendmarkdownconfig) to modify this).
MDX does not support passing remark and rehype plugins as a string. You should install, import, and apply the plugin function instead.
289
-
:::
290
-
291
291
<ReadMore>See the [Markdown Options reference](/en/reference/configuration-reference/#markdown-options) for a complete list of options.</ReadMore>
292
292
293
+
### `processor`
294
+
295
+
<p>
296
+
297
+
**Type:**`MarkdownProcessor`<br />
298
+
**Default:** inherited from [`markdown.processor`](/en/reference/configuration-reference/#markdownprocessor)<br />
299
+
<Sincev="6.0.0"pkg="@astrojs/mdx" />
300
+
</p>
301
+
302
+
By default, `.mdx` files render through the same [Markdown processor](/en/guides/markdown-content/#choosing-a-markdown-processor) as your `.md` files. Set `processor` to use a different processor, or the same processor with different options, for `.mdx` files only.
303
+
304
+
For example, to keep the default remark/rehype processor for `.md` files while rendering `.mdx` files with [Sätteri](https://satteri.bruits.org/) using `@astrojs/markdown-satteri`:
@@ -301,28 +326,27 @@ MDX does not support passing remark and rehype plugins as a string. You should i
301
326
302
327
MDX will extend [your project's existing Markdown configuration](/en/reference/configuration-reference/#markdown-options) by default. To override individual options, you can specify their equivalent in your MDX configuration.
303
328
304
-
For example, say you need to disable GitHub-Flavored Markdown and apply a different set of remark plugins for MDX files. You can apply these options like so, with `extendMarkdownConfig` enabled by default:
329
+
For example, say you need a different syntax highlighter and a different set of plugins for `.mdx` files. You can apply these options like so, with `extendMarkdownConfig` enabled by default:
0 commit comments