mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-09 14:22:27 +02:00
feat(mdx): support recma plugins (#10241)
This commit is contained in:
parent
4ad425a88f
commit
cc506c8950
18 changed files with 45 additions and 0 deletions
|
@ -54,6 +54,7 @@ export type MDXOptions = {
|
|||
admonitions: boolean | Partial<AdmonitionOptions>;
|
||||
remarkPlugins: MDXPlugin[];
|
||||
rehypePlugins: MDXPlugin[];
|
||||
recmaPlugins: MDXPlugin[];
|
||||
beforeDefaultRemarkPlugins: MDXPlugin[];
|
||||
beforeDefaultRehypePlugins: MDXPlugin[];
|
||||
};
|
||||
|
@ -150,6 +151,10 @@ async function createProcessorFactory() {
|
|||
...(options.rehypePlugins ?? []),
|
||||
];
|
||||
|
||||
// Maybe we'll want to introduce default recma plugins later?
|
||||
// For example https://github.com/domdomegg/recma-mdx-displayname ?
|
||||
const recmaPlugins = [...(options.recmaPlugins ?? [])];
|
||||
|
||||
if (format === 'md') {
|
||||
// This is what permits to embed HTML elements with format 'md'
|
||||
// See https://github.com/facebook/docusaurus/pull/8960
|
||||
|
@ -173,6 +178,7 @@ async function createProcessorFactory() {
|
|||
...options,
|
||||
remarkPlugins,
|
||||
rehypePlugins,
|
||||
recmaPlugins,
|
||||
providerImportSource: '@mdx-js/react',
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue