Markdown.TryExtractFrontMatter Method
- Namespace
- Kampute.DocToolkit.Support
- Assembly
- Kampute.DocToolkit.dll
Definition
Attempts to extract and parse the front matter block from Markdown content.
public static bool TryExtractFrontMatter(ReadOnlySpan<char> content, out IReadOnlyDictionary<string, object> frontMatter, out int contentStart)Parameters
contentReadOnlySpan<char>- The Markdown content to inspect.
frontMatterIReadOnlyDictionary<string, object>- When this method returns, contains the parsed front matter metadata if found; otherwise, an empty dictionary.
contentStartint- When this method returns, contains the index in
contentat which the body content starts.
Returns
Exceptions
- FormatException
- Thrown when a front matter block is found but cannot be parsed as valid YAML.

---on its own line. The closing delimiter may be either---or....