Skip to content

Commit 2fd325c

Browse files
committedMar 28, 2025
Core: Enable lazy on rehypeCode by default
1 parent c9cccba commit 2fd325c

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed
 

‎.changeset/major-candies-grab.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'fumadocs-core': minor
3+
---
4+
5+
Enable `lazy` on `rehypeCode` by default

‎packages/core/src/mdx-plugins/rehype-code.ts

+1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ const metaValues: MetaValue[] = [
4949
];
5050

5151
export const rehypeCodeDefaultOptions: RehypeCodeOptions = {
52+
lazy: true,
5253
themes: defaultThemes,
5354
defaultColor: false,
5455
defaultLanguage: 'plaintext',

‎packages/mdx/src/utils/mdx-options.ts

+1-8
Original file line numberDiff line numberDiff line change
@@ -82,14 +82,7 @@ export function getDefaultMDXOptions({
8282

8383
const rehypePlugins = pluginOption(
8484
(v) => [
85-
rehypeCodeOptions !== false && [
86-
plugins.rehypeCode,
87-
{
88-
lazy: true,
89-
langs: ['ts', 'js', 'html', 'tsx', 'mdx'],
90-
...rehypeCodeOptions,
91-
},
92-
],
85+
rehypeCodeOptions !== false && [plugins.rehypeCode, rehypeCodeOptions],
9386
...v,
9487
[plugins.rehypeToc],
9588
],

0 commit comments

Comments
 (0)
Please sign in to comment.