Cannot render markdown strings stored in a yaml file
See original GitHub issueEnvironment
- Operating System:
Linux
- Node Version:
v16.18.0
- Nuxt Version:
3.0.0-rc.11
- Nitro Version:
0.5.4
- Package Manager:
npm@8.19.2
- Builder:
vite
- User Config:
-
- Runtime Modules:
-
- Build Modules:
-
Reproduction
- yaml file in the content folder with a key value pair that contains markdown syntax (~/content/file.yml)
title: test file
description: this has **markdown**
- access the data in the vue template:
let { data } = await useAsyncData(() => { return queryContent("file".findOne();
- Render the description into html:
<p><ContentRendererMarkdown :value="data.description" />
Output:
Describe the bug
The hope is to be able to send the markdown syntax into the template from the yaml file as just a string and to render it.
I’ve tried a few ways, this felt like it would have been the most logical however it doesn’t convert the markdown into html.
Additional context
A major reason for why we are using this workflow is to integrate with Netlify CMS as a simple UI for non-technical contributors to help out (this is for a website for the Fedora Project).
Logs
No response
Issue Analytics
- State:
- Created a year ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
How to output data from Yaml variables (written in markdown ...
You have a string that contains markdown, and you want to render that markdown and include the result in your output.
Read more >YAML: The Missing Battery in Python
In this tutorial, you'll learn all about working with YAML in Python. By the end of it, you'll know about the available libraries, ......
Read more >SSM document data elements - AWS Systems Manager
This topic describes the data elements used in Command and Automation SSM documents. The schema version used to create a document defines the...
Read more >YAML & Markdown | Quire
Content is stored in two different plain-text formats in Quire: YAML (yam-ul) for data, and Markdown for more narrative or textual content.
Read more >Configuration - Grav Documentation
All Grav configuration files are written in YAML syntax with a .yaml file ... used to render the site, page ordering, twig and...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This is not possible at the time, supporting this feature means that we should ship whole markdown parser into browser which creates two issues:
If you have a specific structure and you want to render markdown from
description
field. You can create customtransformer
for.yaml
files and parse the field, then you will be able to useContentRendererMarkdown
to render the description.Here is simple example:
@farnabaz Oh, so in V2, it’s more intelligent, nice 😋 thanks for the detailed information and your invaluable contributions.