nuxt/content markdownParser change local options

I use import markdownParser from '@nuxt/content/transformers/markdown' to parse the markdown like this:
const parseMessage = async (message) => {
const parsedContent = await markdownParser.parse(null, message.content)
return { ...message, parsedContent }
}
const parseMessage = async (message) => {
const parsedContent = await markdownParser.parse(null, message.content)
return { ...message, parsedContent }
}
It works well but automatically replaces markdown headings like ### Heading with links+anchortags like this:
<h3 id="test"><a href="#test"><strong>test:</strong></a></h3>
<h3 id="test"><a href="#test"><strong>test:</strong></a></h3>
I want to keep 'normal' header tags without links etc. so I'm looking for an option to change this behavior in my component. If possible, I don't want to disable this functionality globally in my nuxt config because I might need it later in a blog component.
2 Replies
manniL
manniL6mo ago
you can update that based on the remark/rehype plugins used. See https://github.com/nuxt-modules/mdc?tab=readme-ov-file#options
GitHub
GitHub - nuxt-modules/mdc: MDC supercharges regular Markdown to wri...
MDC supercharges regular Markdown to write documents interacting deeply with any Vue component. - nuxt-modules/mdc
manniL
manniL6mo ago
(+ if you don't need nuxt ocntent but only markdown, use https://github.com/nuxt-modules/mdc)
Want results from more Discord servers?
Add your server