nuxt/content2 parse markdown string runtime

Viewed 35

I have a basic Nuxt3 + @nuxt/content v2 setup. There is a .yaml file in the content folder that has fields whose values are markdown strings ( this file is produced by Netlify CMS) i.e:

# content/post.yaml
title: Some title
body: Some **markdown** content

I can fetch the file using queryContent, but what do I use to parse and render the markdown in those fields?

The provided <Markdown /> component seems to accept only parsed markdown in the format that is returned when queryContent is called on .md files. But I cannot find an API exposed by @nuxt/content to parse markdown string into that format runtime (i.e in my useAsynData hook ).

0 Answers
Related