Skip to content

Commit

Permalink
chore: upgrade deps
Browse files Browse the repository at this point in the history
  • Loading branch information
farnabaz committed Nov 19, 2024
1 parent 7a2ebba commit 3742d94
Show file tree
Hide file tree
Showing 3 changed files with 115 additions and 23 deletions.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@
"wrangler": "^3.85.0"
},
"resolutions": {
"remark-mdc": "npm:remark-mdc-edge@latest",
"@nuxtjs/mdc": "npm:@nuxtjs/mdc-edge@latest",
"@nuxt/content": "workspace:*",
"@nuxt/ui-pro": "https://pkg.pr.new/@nuxt/ui-pro@3623989",
"vue": "^3.5.12"
Expand Down
126 changes: 106 additions & 20 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 7 additions & 3 deletions src/utils/content/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,19 +100,23 @@ async function _getHighlightPlugin(options: HighlighterOptions) {
export async function parseContent(key: string, content: string, collection: ResolvedCollection, nuxt?: Nuxt) {
const mdcOptions = (nuxt?.options as unknown as { mdc: MDCModuleOptions })?.mdc || {}
const contentOptions = (nuxt?.options as unknown as { content: ModuleOptions })?.content?.build?.markdown || {}

const rehypeHighlightPlugin = contentOptions.highlight !== false
? await getHighlightPluginInstance(defu(contentOptions.highlight as HighlighterOptions, mdcOptions.highlight, { compress: true }))
: undefined

const parsedContent = await transformContent(key, content, {
markdown: {
compress: true,
...mdcOptions,
...contentOptions,
rehypePlugins: {
highlight: mdcOptions.highlight === false
? undefined
: await getHighlightPluginInstance({ ...mdcOptions.highlight, compress: (mdcOptions as { compress: boolean })?.compress !== false }),
highlight: rehypeHighlightPlugin,
...mdcOptions?.rehypePlugins,
...contentOptions?.rehypePlugins,
},
remarkPlugins: {
'remark-emoji': {},
...mdcOptions?.remarkPlugins,
...contentOptions?.remarkPlugins,
},
Expand Down

0 comments on commit 3742d94

Please sign in to comment.