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

@ -7,7 +7,8 @@
module.exports.newLineRe = /\r[\n\u0085]?|[\n\u2424\u2028\u0085]/;
// 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
const inlineCommentRe =