Skip to content

Commit

Permalink
fix(module): Content module options has priority over MDC module options
Browse files Browse the repository at this point in the history
  • Loading branch information
farnabaz committed Oct 31, 2024
1 parent 1668284 commit 19f1b5d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/utils/mdc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ export async function installMDCModule(contentOptions: ModuleOptions, nuxt: Nuxt
const options = nuxt.options as unknown as { mdc: MDCModuleOptions, content: ModuleOptions }
// Install mdc module
const highlight = options.content?.build?.markdown?.highlight as unknown as MDCModuleOptions['highlight']
options.mdc = defu(options.mdc, {

options.mdc = defu({
highlight: highlight ? { ...highlight, noApiRoute: true } : highlight,
components: {
prose: true,
Expand All @@ -19,7 +20,7 @@ export async function installMDCModule(contentOptions: ModuleOptions, nuxt: Nuxt
headings: {
anchorLinks: contentOptions.renderer.anchorLinks,
},
}) as MDCModuleOptions
}, options.mdc) as MDCModuleOptions

// Hook into mdc configs and store them for parser
await nuxt.hook('mdc:configSources', async (mdcConfigs) => {
Expand Down

0 comments on commit 19f1b5d

Please sign in to comment.