mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-09-21 21:30:47 +02:00
Update MD043/required-headings to support "?" meaning "exactly one unspecified heading" (fixes #475).
This commit is contained in:
parent
06b60b7372
commit
5749c8dcf7
15 changed files with 297 additions and 18 deletions
26
doc/Rules.md
26
doc/Rules.md
|
@ -1767,7 +1767,7 @@ structure for a set of files.
|
|||
To require exactly the following structure:
|
||||
|
||||
```markdown
|
||||
# Head
|
||||
# Heading
|
||||
## Item
|
||||
### Detail
|
||||
```
|
||||
|
@ -1776,7 +1776,7 @@ Set the `headings` parameter to:
|
|||
|
||||
```json
|
||||
[
|
||||
"# Head",
|
||||
"# Heading",
|
||||
"## Item",
|
||||
"### Detail"
|
||||
]
|
||||
|
@ -1785,7 +1785,7 @@ Set the `headings` parameter to:
|
|||
To allow optional headings as with the following structure:
|
||||
|
||||
```markdown
|
||||
# Head
|
||||
# Heading
|
||||
## Item
|
||||
### Detail (optional)
|
||||
## Foot
|
||||
|
@ -1798,7 +1798,7 @@ special value `"+"` meaning "one or more unspecified headings" and set the
|
|||
|
||||
```json
|
||||
[
|
||||
"# Head",
|
||||
"# Heading",
|
||||
"## Item",
|
||||
"*",
|
||||
"## Foot",
|
||||
|
@ -1806,6 +1806,24 @@ special value `"+"` meaning "one or more unspecified headings" and set the
|
|||
]
|
||||
```
|
||||
|
||||
To allow a single required heading to vary as with a project name:
|
||||
|
||||
```markdown
|
||||
# Project Name
|
||||
## Description
|
||||
## Examples
|
||||
```
|
||||
|
||||
Use the special value `"?"` meaning "exactly one unspecified heading":
|
||||
|
||||
```json
|
||||
[
|
||||
"?",
|
||||
"## Description",
|
||||
"## Examples"
|
||||
]
|
||||
```
|
||||
|
||||
When an error is detected, this rule outputs the line number of the first
|
||||
problematic heading (otherwise, it outputs the last line number of the file).
|
||||
|
||||
|
|
26
doc/md043.md
26
doc/md043.md
|
@ -16,7 +16,7 @@ structure for a set of files.
|
|||
To require exactly the following structure:
|
||||
|
||||
```markdown
|
||||
# Head
|
||||
# Heading
|
||||
## Item
|
||||
### Detail
|
||||
```
|
||||
|
@ -25,7 +25,7 @@ Set the `headings` parameter to:
|
|||
|
||||
```json
|
||||
[
|
||||
"# Head",
|
||||
"# Heading",
|
||||
"## Item",
|
||||
"### Detail"
|
||||
]
|
||||
|
@ -34,7 +34,7 @@ Set the `headings` parameter to:
|
|||
To allow optional headings as with the following structure:
|
||||
|
||||
```markdown
|
||||
# Head
|
||||
# Heading
|
||||
## Item
|
||||
### Detail (optional)
|
||||
## Foot
|
||||
|
@ -47,7 +47,7 @@ special value `"+"` meaning "one or more unspecified headings" and set the
|
|||
|
||||
```json
|
||||
[
|
||||
"# Head",
|
||||
"# Heading",
|
||||
"## Item",
|
||||
"*",
|
||||
"## Foot",
|
||||
|
@ -55,6 +55,24 @@ special value `"+"` meaning "one or more unspecified headings" and set the
|
|||
]
|
||||
```
|
||||
|
||||
To allow a single required heading to vary as with a project name:
|
||||
|
||||
```markdown
|
||||
# Project Name
|
||||
## Description
|
||||
## Examples
|
||||
```
|
||||
|
||||
Use the special value `"?"` meaning "exactly one unspecified heading":
|
||||
|
||||
```json
|
||||
[
|
||||
"?",
|
||||
"## Description",
|
||||
"## Examples"
|
||||
]
|
||||
```
|
||||
|
||||
When an error is detected, this rule outputs the line number of the first
|
||||
problematic heading (otherwise, it outputs the last line number of the file).
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue