mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-16 14:00:13 +01:00
Handle files with front matter only and no trailing newline (fixes #157).
This commit is contained in:
parent
7d6635b472
commit
0bb38faa21
3 changed files with 8 additions and 1 deletions
|
|
@ -7,7 +7,7 @@
|
||||||
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 = /^(---|\+\+\+)$[^]*?^\1$(\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 =
|
||||||
|
|
|
||||||
4
test/front-matter-no-crlf.json
Normal file
4
test/front-matter-no-crlf.json
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"default": true,
|
||||||
|
"MD041": true
|
||||||
|
}
|
||||||
3
test/front-matter-no-crlf.md
Normal file
3
test/front-matter-no-crlf.md
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
---
|
||||||
|
front: matter
|
||||||
|
---
|
||||||
Loading…
Add table
Add a link
Reference in a new issue