@@ -5,6 +5,7 @@ import type { Nuxt } from '@nuxt/schema'
55import { defu } from 'defu'
66import { createOnigurumaEngine } from 'shiki/engine/oniguruma'
77import type { ResolvedCollection } from '../../types/collection'
8+ import type { ModuleOptions } from '../../types/module'
89import { transformContent } from './transformers'
910
1011let parserOptions = {
@@ -66,16 +67,22 @@ async function _getHighlighPlugin(options: HighlighterOptions) {
6667}
6768
6869export async function parseContent ( key : string , content : string , collection : ResolvedCollection , nuxt ?: Nuxt ) {
69- const markdownOptions = ( nuxt ?. options as unknown as { mdc : MDCModuleOptions } ) ?. mdc || { }
70+ const mdcOptions = ( nuxt ?. options as unknown as { mdc : MDCModuleOptions } ) ?. mdc || { }
71+ const contentOptions = ( nuxt ?. options as unknown as { content : ModuleOptions } ) ?. content ?. build ?. markdown || { }
7072 const parsedContent = await transformContent ( key , content , {
7173 markdown : {
7274 compress : true ,
73- ...markdownOptions ,
75+ ...mdcOptions ,
7476 rehypePlugins : {
75- highlight : markdownOptions . highlight === false
77+ highlight : mdcOptions . highlight === false
7678 ? undefined
77- : await getHighlighPluginInstance ( markdownOptions . highlight || { } ) ,
78- ...markdownOptions ?. rehypePlugins ,
79+ : await getHighlighPluginInstance ( mdcOptions . highlight || { } ) ,
80+ ...mdcOptions ?. rehypePlugins ,
81+ ...contentOptions ?. rehypePlugins ,
82+ } ,
83+ remarkPlugins : {
84+ ...mdcOptions ?. remarkPlugins ,
85+ ...contentOptions ?. remarkPlugins ,
7986 } ,
8087 highlight : undefined ,
8188 } ,
0 commit comments