xoofx / markdig

A fast, powerful, CommonMark compliant, extensible Markdown processor for .NET
BSD 2-Clause "Simplified" License
4.29k stars 444 forks source link

Add support for TOML front matter format #565

Open jonjbar opened 3 years ago

jonjbar commented 3 years ago

It looks like the current version of markdig can only support the Yaml front matter format. However, the Hugo static web-site generator also supports the Toml format identified by opening and closing +++. Can the existing Yaml front matter parser be extended to support that feature ? If not, would you consider implementing a Toml front matter parser ?

xoofx commented 3 years ago

The Yaml extension in Markdig is not a fully fledged Yaml parser - and is likely incorrect. I would not recommend to use this method for properly separating Markdown content from a frontmatter content, but instead perform the parsing separately upfront with the different parsers.

Can the existing Yaml front matter parser be extended to support that feature ?

Yes, It could.

If not, would you consider implementing a Toml front matter parser ?

Probably better to rename Yaml extension to a frontmatter extension and allow extensibility here.

Don't have personal spare time/interest for this feature, but PR welcome.