mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-09-21 21:30:47 +02:00
Automatically ignore common front matter; provide option for customization (fixes #2).
This commit is contained in:
parent
cae451967a
commit
a467f8b3e6
11 changed files with 134 additions and 54 deletions
29
README.md
29
README.md
|
@ -77,7 +77,6 @@ playground for learning and exploring.
|
|||
* **MD039** - Spaces inside link text
|
||||
* **MD040** - Fenced code blocks should have a language specified
|
||||
* **MD041** - First line in file should be a top level header
|
||||
* **ignore** - Ignore certain parts of the markdown file (can be `RegExp`, `Function`, `"frontmatter"`), should be used with disabled `MD012`
|
||||
|
||||
See [Rules.md](doc/Rules.md) for more details.
|
||||
|
||||
|
@ -169,6 +168,34 @@ Example:
|
|||
}
|
||||
```
|
||||
|
||||
#### options.frontMatter
|
||||
|
||||
Type: `RegExp`
|
||||
|
||||
Matches any [front matter](http://jekyllrb.com/docs/frontmatter/) found at the
|
||||
beginning of a file.
|
||||
|
||||
Some Markdown content begins with metadata; the default `RegExp` for this option
|
||||
ignores common forms of "front matter". To match differently, specify a custom
|
||||
`RegExp` or use the value `null` to disable the feature.
|
||||
|
||||
Note: Matches must occur at the start of the file.
|
||||
|
||||
Default:
|
||||
|
||||
```js
|
||||
/^---$[^]*?^---$(\r\n|\r|\n)/m
|
||||
```
|
||||
|
||||
Ignores:
|
||||
|
||||
```text
|
||||
---
|
||||
layout: post
|
||||
title: Title
|
||||
---
|
||||
```
|
||||
|
||||
#### options.config
|
||||
|
||||
Type: `Object` mapping `String` to `Boolean | Object`
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue