mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-09-22 05:40:48 +02:00
Allow for trailing spaces after front matter open/close fences (fixes #208).
This commit is contained in:
parent
91b4fcd55f
commit
cd7a65cedd
8 changed files with 36 additions and 2 deletions
|
@ -367,7 +367,7 @@ ignores common forms of "front matter". To match differently, specify a custom
|
||||||
The default value:
|
The default value:
|
||||||
|
|
||||||
```js
|
```js
|
||||||
/((^---$[^]*?^---$)|(^\+\+\+$[^]*?^(\+\+\+|\.\.\.)$))(\r\n|\r|\n|$)/m
|
/((^---\s*$[^]*?^---\s*$)|(^\+\+\+\s*$[^]*?^(\+\+\+|\.\.\.)\s*$))(\r\n|\r|\n|$)/m
|
||||||
```
|
```
|
||||||
|
|
||||||
Ignores [YAML](https://en.wikipedia.org/wiki/YAML) and
|
Ignores [YAML](https://en.wikipedia.org/wiki/YAML) and
|
||||||
|
|
|
@ -8,7 +8,8 @@ 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 =
|
module.exports.frontMatterRe =
|
||||||
/((^---$[^]*?^---$)|(^\+\+\+$[^]*?^(\+\+\+|\.\.\.)$))(\r\n|\r|\n|$)/m;
|
// eslint-disable-next-line max-len
|
||||||
|
/((^---\s*$[^]*?^---\s*$)|(^\+\+\+\s*$[^]*?^(\+\+\+|\.\.\.)\s*$))(\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-title-pandoc-spaces.json
Normal file
4
test/front-matter-title-pandoc-spaces.json
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"default": true,
|
||||||
|
"MD041": true
|
||||||
|
}
|
6
test/front-matter-title-pandoc-spaces.md
Normal file
6
test/front-matter-title-pandoc-spaces.md
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
+++
|
||||||
|
title: "Welcome to pandoc!"
|
||||||
|
date: 2015-11-17 16:16:01 -0600
|
||||||
|
...
|
||||||
|
|
||||||
|
Some plain text here.
|
5
test/front-matter-title-spaces.json
Normal file
5
test/front-matter-title-spaces.json
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
"default": true,
|
||||||
|
"MD013": false,
|
||||||
|
"MD041": true
|
||||||
|
}
|
8
test/front-matter-title-spaces.md
Normal file
8
test/front-matter-title-spaces.md
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
---
|
||||||
|
layout: post
|
||||||
|
title: "Welcome to Jekyll!"
|
||||||
|
date: 2015-11-17 16:16:01 -0600
|
||||||
|
categories: jekyll update
|
||||||
|
---
|
||||||
|
|
||||||
|
Front matter from [Jekyll documentation](https://jekyllrb.com/docs/posts/#a-typical-post).
|
4
test/front-matter-title-toml-spaces.json
Normal file
4
test/front-matter-title-toml-spaces.json
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"default": true,
|
||||||
|
"MD041": true
|
||||||
|
}
|
6
test/front-matter-title-toml-spaces.md
Normal file
6
test/front-matter-title-toml-spaces.md
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
+++
|
||||||
|
date = "2017-01-26T22:17:00+02:00"
|
||||||
|
title = "My document title and heading"
|
||||||
|
+++
|
||||||
|
|
||||||
|
Some plain text here.
|
Loading…
Add table
Add a link
Reference in a new issue