question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Parsing Markdown inside YAML section of FrontMatter

See original GitHub issue

Is it possible to also parse markdown in other parts that are not the “body” of a Markdown file. I’m doing some tests with NetlifyCMS and I have different sections in one page, and some have markdown inside. They get saved to a markdown format inside the YAML part of the .md, like:

---
hero:
  title: This will be the hero text
services:
  - title: This is a title of the first service
    description: Description of this service
    explanation: >-

      * **First** item text

      * **Second** item text

      * **Second** item text
  - title: This is a title of the second service
    description: Description of this service
    explanation: >-

      * **First** item text

      * **Second** item text

      * **Second** item text
---

# Here I have some more text of the body

I would like Nuxt Content to also parse the explanation ul list 😃

Thanks so much for your great job!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:5
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
benjamincanaccommented, Jul 20, 2020

Hey @santicros,

Unfortunately this is not possible at the moment, we’re depending on gray-matter to parse the front-matter which doesn’t seem to support this.

Maybe you can ask them if they plan to support it?

0reactions
violoncelloCHcommented, Aug 15, 2020

hmm, I’m looking for a way to pass a parameter (containing the field(s) to be treated as markdown) from $content(path, options.tomarkdown) to the markdown parsers toJSON() function, but I didn’t find a way to do this so far.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Rendering Markdown to HTML and Parsing YAML Front ...
First of all, to parse the YAML front matter, I used the YamlDotNet NuGet package. It's a little bit fiddly, but you can...
Read more >
yaml_front_matter: Parse the YAML front matter from a file
Arguments ; input. Input file (Rmd or plain markdown) ; encoding. Ignored. The encoding is always assumed to be UTF-8.
Read more >
Parse Markdown Front Matter With C# | Khalid Abuhakmeh
This blog contains all post metadata in a terse front matter block. In this post, you'll see how we can use YAML.NET and...
Read more >
yaml-front-matter - crates.io: Rust Package Registry
YAML Front Matter (YFM) parser for Markdown files. ... This crate takes care of extracting this header from your markdown file and parse...
Read more >
Parsing YAML Front matter in Java - Stack Overflow
The yaml front matter is everything that is inside the lines with three dashes ( --- ). YAML Front matter is ALWAYS at...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found