content icon indicating copy to clipboard operation
content copied to clipboard

Expose remark-rehype options in config

Open JakeIsMeh opened this issue 1 year ago • 3 comments

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: https://github.com/nuxt/content/blob/c769bf87d6d4d9d9c5268aacb57a135217f001ab/src/runtime/transformers/markdown.ts#L29-L44

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

  • [x] I am willing to submit a PR for this feature request

JakeIsMeh avatar Sep 23 '24 22:09 JakeIsMeh

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.

github-actions[bot] avatar Jan 16 '25 15:01 github-actions[bot]

Just tested with v3.

Adding remark-rehype under content.build.markdown.remarkPlugins still doesn't work.

JakeIsMeh avatar Jan 19 '25 21:01 JakeIsMeh

bump

L33Z22L11 avatar Aug 16 '25 14:08 L33Z22L11