Handle files with front matter only and no trailing newline (fixes #157).

This commit is contained in:
David Anson 2019-01-06 22:20:59 -08:00
parent 7d6635b472
commit 0bb38faa21
3 changed files with 8 additions and 1 deletions

View file

@ -7,7 +7,7 @@
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 = /^(---|\+\+\+)$[^]*?^\1$(\r\n|\r|\n|$)/m;
// Regular expression for matching inline disable/enable comments
const inlineCommentRe =

View file

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

View file

@ -0,0 +1,3 @@
---
front: matter
---