完善 mdx 文件处理,修复代码高亮问题

This commit is contained in:
2025-12-09 11:22:30 +08:00
parent bdb6264825
commit 5202f8190e
8 changed files with 105 additions and 73 deletions

View File

@@ -1,7 +1,17 @@
import type {MDXComponents} from 'mdx/types'
const components: MDXComponents = {}
import {merge} from './lib/utils'
export function useMDXComponents(): MDXComponents {
return components
return {
wrapper: props => (
<article
{...props}
className={merge(
`prose max-w-none`,
props.className,
)}>
{props.children}
</article>
),
}
}