mirror of
https://github.com/xoofx/markdig.git
synced 2026-02-03 21:36:36 +00:00
How to get YAML front matter? #295
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @lloydjatkinson on GitHub (May 26, 2019).
Given a markdown file, how do we get access to the YAML front matter?
For example I have:
When I parse a markdown file I'd like to be able to also get the YAML front matter, probably as a dictionary (or even a plain string that we could use with a YAML parser...).
@MihaZupan commented on GitHub (May 26, 2019):
The Yaml extension does not do any yaml parsing, only detects its start and end. It does emit a
YamlFrontMatterBlockthat you can then access in the AST.