Support JSON front matter as used by the Hugo site generator (fixes #270).

This commit is contained in:
David Anson 2020-11-14 19:40:15 -08:00
parent 47d82d6fd4
commit bb157b2ce7
11 changed files with 60 additions and 7 deletions

View file

@ -429,11 +429,12 @@ ignores common forms of "front matter". To match differently, specify a custom
The default value:
```js
/((^---\s*$[^]*?^---\s*$)|(^\+\+\+\s*$[^]*?^(\+\+\+|\.\.\.)\s*$))(\r\n|\r|\n|$)/m
/((^---\s*$[^]*?^---\s*$)|(^\+\+\+\s*$[^]*?^(\+\+\+|\.\.\.)\s*$)|(^\{\s*$[^]*?^\}\s*$))(\r\n|\r|\n|$)/m
```
Ignores [YAML](https://en.wikipedia.org/wiki/YAML) and
[TOML](https://en.wikipedia.org/wiki/TOML) such as:
Ignores [YAML](https://en.wikipedia.org/wiki/YAML),
[TOML](https://en.wikipedia.org/wiki/TOML), and
[JSON](https://en.wikipedia.org/wiki/JSON) front matter such as:
```text
---