Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose remark-rehype options in config #2793

Open
1 task done
JakeIsMeh opened this issue Sep 23, 2024 · 0 comments
Open
1 task done

Expose remark-rehype options in config #2793

JakeIsMeh opened this issue Sep 23, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@JakeIsMeh
Copy link

JakeIsMeh commented Sep 23, 2024

Is your feature request related to a problem? Please describe

I'm trying to configure remark-rehype, particularly for footnotes. parseMarkdown() from @nuxtjs/mdc directly exposes this ability, but looking at src/runtime/transformers/markdown.ts, it seems that I cannot do it because the config object is spread at the top rather than the bottom of the object passed to parseMarkdown() which means it gets overridden:

const parsed = await parseMarkdown(content as string, {
...config,
highlight: highlightOptions,
remark: {
plugins: config.remarkPlugins
},
rehype: {
options: {
handlers: {
link: link as any
}
},
plugins: config.rehypePlugins
},
toc: config.toc
})

Additionally, this is not exposed in the module configuration for @nuxt/content which results in a type error when attempting to declare the config.

Describe the solution you'd like

I'd like for something like rehypeOptions to be exposed in the module config that is passed directly to parseMarkdown()

Describe alternatives you've considered

I tried directly configuring @nuxtjs/mdc rather than @nuxt/content but given that it uses parseMarkdown() directly it was never going to work.

Additional context

  • I am willing to submit a PR for this feature request
@JakeIsMeh JakeIsMeh added the enhancement New feature or request label Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant