Add support for "markdownlint-configure-file" inline comments (fixes #264).

This commit is contained in:
David Anson 2020-04-05 19:47:12 -07:00
parent dd66a33d75
commit 6ce426cf88
7 changed files with 183 additions and 56 deletions

View file

@ -196,6 +196,33 @@ the following syntax is supported:
This can be used to "hide" `markdownlint` comments at the bottom of a file.
In cases where it is desirable to change the configuration of one or more rules
for a file, the following more advanced syntax is supported:
* Confiure: `<!-- markdownlint-configure-file { options.config JSON } -->`
For example:
```markdown
<!-- markdownlint-configure-file { "MD013": { "line_length": 70 } } -->
```
or
```markdown
<!-- markdownlint-configure-file
{
"hr-style": {
"style": "---"
},
"no-trailing-spaces": false
}
-->
```
These changes apply to the entire file regardless of where the comment is
located. Multiple such comments (if present) are applied top-to-bottom.
## API
### Linting