Add support for pandoc-style YAML front matter fences ---/... (fixes #153).

This commit is contained in:
David Anson 2019-03-17 22:05:50 -07:00
parent 61d6311a3e
commit df2507f030
4 changed files with 13 additions and 2 deletions

View file

@ -342,7 +342,7 @@ ignores common forms of "front matter". To match differently, specify a custom
The default value: The default value:
```js ```js
/^(---|\+\+\+)$[^]*?^\1$(\r\n|\r|\n)/m /((^---$[^]*?^---$)|(^\+\+\+$[^]*?^(\+\+\+|\.\.\.)$))(\r\n|\r|\n|$)/m
``` ```
Ignores [YAML](https://en.wikipedia.org/wiki/YAML) and Ignores [YAML](https://en.wikipedia.org/wiki/YAML) and

View file

@ -7,7 +7,8 @@
module.exports.newLineRe = /\r[\n\u0085]?|[\n\u2424\u2028\u0085]/; module.exports.newLineRe = /\r[\n\u0085]?|[\n\u2424\u2028\u0085]/;
// Regular expression for matching common front matter (YAML and TOML) // Regular expression for matching common front matter (YAML and TOML)
module.exports.frontMatterRe = /^(---|\+\+\+)$[^]*?^\1$(\r\n|\r|\n|$)/m; module.exports.frontMatterRe =
/((^---$[^]*?^---$)|(^\+\+\+$[^]*?^(\+\+\+|\.\.\.)$))(\r\n|\r|\n|$)/m;
// Regular expression for matching inline disable/enable comments // Regular expression for matching inline disable/enable comments
const inlineCommentRe = const inlineCommentRe =

View file

@ -0,0 +1,4 @@
{
"default": true,
"MD041": true
}

View file

@ -0,0 +1,6 @@
+++
title: "Welcome to pandoc!"
date: 2015-11-17 16:16:01 -0600
...
Some plain text here.