nuxt / content

The file-based CMS for your Nuxt application, powered by Markdown and Vue components.
https://content.nuxt.com
MIT License
3.12k stars 623 forks source link

Is it possible to use markdown-it instead of remark for Markdown rendering? #934

Open ElnuDev opened 3 years ago

ElnuDev commented 3 years ago

Is it possible to use markdown-it instead of remark? It has way more plugins available.

ElnuDev commented 3 years ago

Well, I managed to get markdown-it working by setting options.text to true whenever I use $content and then bypassing <nuxt-content> entirely by using @nuxtjs/markdownit and <div v-html="$md.render(content.text)"></div>. It still would be nice to be able to use other markdown renderers in <nuxt-content>, though.

atinux commented 3 years ago

Hi @ElnuDev

In order to use Vue components in the Markdown, we need the AST and that's what remark provides.

ElnuDev commented 3 years ago

Not everybody is going to need to necessarily be able to use Vue components in Markdown in their projects, so it still would be nice to have the option to use a different renderer while still using <nuxt-content>.

atinux commented 3 years ago

Re-opening for the nuxt content v2 that will be much simplier with different transformers supported. Cc @pi0

ChristianMurphy commented 3 years ago

I'm all for flexible parsing of markdown. :+1:

I'm not sure assertion motivating this is accurate though...

[markdown-it] has way more plugins available.

Remark has more plugins, a lot more: https://github.com/remarkjs/remark/blob/main/doc/plugins.md#list-of-plugins, https://github.com/topics/remark-plugin, and https://www.npmjs.com/search?q=keywords%3Aremark

For support on adding specific syntax or getting a specific feature it may be worth reaching out the the remark community https://github.com/remarkjs/remark/discussions