mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-31 23:40:39 +02:00
feat(core): add siteConfig.markdown.emoji
config option to disable remark-emoji
(#11282)
This commit is contained in:
parent
96c38d5fdd
commit
e14caf1f78
7 changed files with 87 additions and 9 deletions
|
@ -541,6 +541,7 @@ type MarkdownHooks = {
|
|||
type MarkdownConfig = {
|
||||
format: 'mdx' | 'md' | 'detect';
|
||||
mermaid: boolean;
|
||||
emoji: boolean;
|
||||
preprocessor?: MarkdownPreprocessor;
|
||||
parseFrontMatter?: ParseFrontMatter;
|
||||
mdx1Compat: MDX1CompatOptions;
|
||||
|
@ -557,6 +558,7 @@ export default {
|
|||
markdown: {
|
||||
format: 'mdx',
|
||||
mermaid: true,
|
||||
emoji: true,
|
||||
preprocessor: ({filePath, fileContent}) => {
|
||||
return fileContent.replaceAll('{{MY_VAR}}', 'MY_VALUE');
|
||||
},
|
||||
|
@ -590,6 +592,7 @@ export default {
|
|||
| --- | --- | --- | --- |
|
||||
| `format` | `'mdx' \| 'md' \| 'detect'` | `'mdx'` | The default parser format to use for Markdown content. Using 'detect' will select the appropriate format automatically based on file extensions: `.md` vs `.mdx`. |
|
||||
| `mermaid` | `boolean` | `false` | When `true`, allows Docusaurus to render Markdown code blocks with `mermaid` language as Mermaid diagrams. |
|
||||
| `emoji` | `boolean` | `true` | When `true`, allows Docusaurus to render emoji shortcodes (e.g., `:+1:`) as Unicode emoji (👍). When `false`, emoji shortcodes are left as-is. |
|
||||
| `preprocessor` | `MarkdownPreprocessor` | `undefined` | Gives you the ability to alter the Markdown content string before parsing. Use it as a last-resort escape hatch or workaround: it is almost always better to implement a Remark/Rehype plugin. |
|
||||
| `parseFrontMatter` | `ParseFrontMatter` | `undefined` | Gives you the ability to provide your own front matter parser, or to enhance the default parser. Read our [front matter guide](../guides/markdown-features/markdown-features-intro.mdx#front-matter) for details. |
|
||||
| `mdx1Compat` | `MDX1CompatOptions` | `{comments: true, admonitions: true, headingIds: true}` | Compatibility options to make it easier to upgrade to Docusaurus v3+. |
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue