Repository: denoland/std (TypeScript)

Issue:
TOML frontmatter extraction should look between +++ instead of ---
**Describe the bug**

**Steps to Reproduce**

extract TOML frontmatter from a hugo/zola blog post:

```
+++
title = "Title"
+++
Content
```

using https://deno.land/std@0.171.0/encoding/front_matter/toml.ts doen't extract the frontmatter at all as it looks between `---`instead of `+++`

**Expected behavior**

Extract the TOML frontmatter contained within `+++`
<!-- A clear and concise description of what you expected to happen. -->

**Environment**

- OS: MacOS 12.4
- deno version: 1.29.2 / v8 10.9.194.5 / typescript 4.9.4
- std version:0.170.0


see https://github.com/denoland/deno_std/blob/main/encoding/front_matter/mod.ts#L176 where separator for TOML is `---` instead of `+++` (as described in https://gohugo.io/content-management/front-matter/#front-matter-formats)



Discussion: Is this convention common across tools? Or specific to Hugo?
It's definitely not in the spec (ref: https://github.com/toml-lang/toml/issues/511). I think that this is application-specific, but I honestly don't see a lot of tools that use toml front matter in general. I would be okay with changing it just because of Hugo because Hugo is the only tool I know of that even offers it as an option.

Alternatively, maybe this is an option we can provide instead (though that looks to be difficult given there is a lot of regex involved)?

As an aside: for a language that claims to be designed around simplicity, parsing it sure seems to be a nightmare.
Hi, both [zola](https://www.getzola.org/) and [hugo](https://gohugo.io/) use `+++`as the TOML delimiter.
I guess the better question is: are there tools that DON'T user `+++` as the TOML delimiter? If so, then this is a breaking change for (in my opinion), limited gain.

Why don't we parse `---` `---toml` AND `+++` instead of just picking between `---` and `+++`? I feel like that would be the best for everyone in this situation.
I researched a bit about toml front matter support across tools:

### `+++`

- Forestry also uses `+++` https://forestry.io/docs/faqs/glossary/front-matter/#toml

(in addition to zola and hugo)

### `---toml`

- 11ty uses `---toml` (via gray-matter) https://www.11ty.dev/docs/data-frontmatter-customize/
- vuepress uses `--toml` (via gray-matter) https://vuepress.vuejs.org/guide/frontmatter.html#alternative-frontmatter-formats
- gatsby, gridsome also use gray-matter internally. Probably the same rule applies to it.

(further inputs are very welcome)

---

It looks reasonable to add `+++` support to toml front matter, but let's keep `---toml` as it looks also common across tools. I agree with the suggestion by @lino-levan 
Good to know I'm not completely off base 😄. Cool to see a more complete analysis of tools.



Fix (patch):
diff --git a/front_matter/mod.ts b/front_matter/mod.ts
index a634a4ff9f87..9a4ab94ca2d2 100644
--- a/front_matter/mod.ts
+++ b/front_matter/mod.ts
@@ -129,6 +129,13 @@
  * = toml =
  * ```
  *
+ * ```markdown
+ * +++
+ * is = 'that'
+ * not = 'cool?'
+ * +++
+ * ```
+ *
  * #### JSON
  *
  * ```markdown
@@ -175,6 +182,7 @@ const [RX_RECOGNIZE_YAML, RX_YAML] = createRegExp(
 );
 const [RX_RECOGNIZE_TOML, RX_TOML] = createRegExp(
   ["---toml", "---"],
+  "\\+\\+\\+",
   "= toml =",
 );
 const [RX_RECOGNIZE_JSON, RX_JSON] = createRegExp(