mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-09-21 21:30:47 +02:00
Change "header" to "heading" across the library
This should be backward compatible, as all "header" aliases are still available, though documented as discouraged for future use.
This commit is contained in:
parent
e938f421a9
commit
45424cf459
148 changed files with 861 additions and 699 deletions
66
README.md
66
README.md
|
@ -46,9 +46,9 @@ playground for learning and exploring.
|
||||||
|
|
||||||
## Rules / Aliases
|
## Rules / Aliases
|
||||||
|
|
||||||
* **[MD001](doc/Rules.md#md001)** *header-increment* - Header levels should only increment by one level at a time
|
* **[MD001](doc/Rules.md#md001)** *heading-increment, header-increment* - Heading levels should only increment by one level at a time
|
||||||
* **[MD002](doc/Rules.md#md002)** *first-header-h1* - First header should be a top level header
|
* **[MD002](doc/Rules.md#md002)** *first-heading-h1, first-header-h1* - First heading should be a top level heading
|
||||||
* **[MD003](doc/Rules.md#md003)** *header-style* - Header style
|
* **[MD003](doc/Rules.md#md003)** *heading-style, header-style* - Heading style
|
||||||
* **[MD004](doc/Rules.md#md004)** *ul-style* - Unordered list style
|
* **[MD004](doc/Rules.md#md004)** *ul-style* - Unordered list style
|
||||||
* **[MD005](doc/Rules.md#md005)** *list-indent* - Inconsistent indentation for list items at the same level
|
* **[MD005](doc/Rules.md#md005)** *list-indent* - Inconsistent indentation for list items at the same level
|
||||||
* **[MD006](doc/Rules.md#md006)** *ul-start-left* - Consider starting bulleted lists at the beginning of the line
|
* **[MD006](doc/Rules.md#md006)** *ul-start-left* - Consider starting bulleted lists at the beginning of the line
|
||||||
|
@ -59,15 +59,15 @@ playground for learning and exploring.
|
||||||
* **[MD012](doc/Rules.md#md012)** *no-multiple-blanks* - Multiple consecutive blank lines
|
* **[MD012](doc/Rules.md#md012)** *no-multiple-blanks* - Multiple consecutive blank lines
|
||||||
* **[MD013](doc/Rules.md#md013)** *line-length* - Line length
|
* **[MD013](doc/Rules.md#md013)** *line-length* - Line length
|
||||||
* **[MD014](doc/Rules.md#md014)** *commands-show-output* - Dollar signs used before commands without showing output
|
* **[MD014](doc/Rules.md#md014)** *commands-show-output* - Dollar signs used before commands without showing output
|
||||||
* **[MD018](doc/Rules.md#md018)** *no-missing-space-atx* - No space after hash on atx style header
|
* **[MD018](doc/Rules.md#md018)** *no-missing-space-atx* - No space after hash on atx style heading
|
||||||
* **[MD019](doc/Rules.md#md019)** *no-multiple-space-atx* - Multiple spaces after hash on atx style header
|
* **[MD019](doc/Rules.md#md019)** *no-multiple-space-atx* - Multiple spaces after hash on atx style heading
|
||||||
* **[MD020](doc/Rules.md#md020)** *no-missing-space-closed-atx* - No space inside hashes on closed atx style header
|
* **[MD020](doc/Rules.md#md020)** *no-missing-space-closed-atx* - No space inside hashes on closed atx style heading
|
||||||
* **[MD021](doc/Rules.md#md021)** *no-multiple-space-closed-atx* - Multiple spaces inside hashes on closed atx style header
|
* **[MD021](doc/Rules.md#md021)** *no-multiple-space-closed-atx* - Multiple spaces inside hashes on closed atx style heading
|
||||||
* **[MD022](doc/Rules.md#md022)** *blanks-around-headers* - Headers should be surrounded by blank lines
|
* **[MD022](doc/Rules.md#md022)** *blanks-around-headings, blanks-around-headers* - Headings should be surrounded by blank lines
|
||||||
* **[MD023](doc/Rules.md#md023)** *header-start-left* - Headers must start at the beginning of the line
|
* **[MD023](doc/Rules.md#md023)** *heading-start-left, header-start-left* - Headings must start at the beginning of the line
|
||||||
* **[MD024](doc/Rules.md#md024)** *no-duplicate-header* - Multiple headers with the same content
|
* **[MD024](doc/Rules.md#md024)** *no-duplicate-heading, no-duplicate-header* - Multiple headings with the same content
|
||||||
* **[MD025](doc/Rules.md#md025)** *single-h1* - Multiple top level headers in the same document
|
* **[MD025](doc/Rules.md#md025)** *single-h1* - Multiple top level headings in the same document
|
||||||
* **[MD026](doc/Rules.md#md026)** *no-trailing-punctuation* - Trailing punctuation in header
|
* **[MD026](doc/Rules.md#md026)** *no-trailing-punctuation* - Trailing punctuation in heading
|
||||||
* **[MD027](doc/Rules.md#md027)** *no-multiple-space-blockquote* - Multiple spaces after blockquote symbol
|
* **[MD027](doc/Rules.md#md027)** *no-multiple-space-blockquote* - Multiple spaces after blockquote symbol
|
||||||
* **[MD028](doc/Rules.md#md028)** *no-blanks-blockquote* - Blank line inside blockquote
|
* **[MD028](doc/Rules.md#md028)** *no-blanks-blockquote* - Blank line inside blockquote
|
||||||
* **[MD029](doc/Rules.md#md029)** *ol-prefix* - Ordered list item prefix
|
* **[MD029](doc/Rules.md#md029)** *ol-prefix* - Ordered list item prefix
|
||||||
|
@ -77,19 +77,23 @@ playground for learning and exploring.
|
||||||
* **[MD033](doc/Rules.md#md033)** *no-inline-html* - Inline HTML
|
* **[MD033](doc/Rules.md#md033)** *no-inline-html* - Inline HTML
|
||||||
* **[MD034](doc/Rules.md#md034)** *no-bare-urls* - Bare URL used
|
* **[MD034](doc/Rules.md#md034)** *no-bare-urls* - Bare URL used
|
||||||
* **[MD035](doc/Rules.md#md035)** *hr-style* - Horizontal rule style
|
* **[MD035](doc/Rules.md#md035)** *hr-style* - Horizontal rule style
|
||||||
* **[MD036](doc/Rules.md#md036)** *no-emphasis-as-header* - Emphasis used instead of a header
|
* **[MD036](doc/Rules.md#md036)** *no-emphasis-as-heading, no-emphasis-as-header* - Emphasis used instead of a heading
|
||||||
* **[MD037](doc/Rules.md#md037)** *no-space-in-emphasis* - Spaces inside emphasis markers
|
* **[MD037](doc/Rules.md#md037)** *no-space-in-emphasis* - Spaces inside emphasis markers
|
||||||
* **[MD038](doc/Rules.md#md038)** *no-space-in-code* - Spaces inside code span elements
|
* **[MD038](doc/Rules.md#md038)** *no-space-in-code* - Spaces inside code span elements
|
||||||
* **[MD039](doc/Rules.md#md039)** *no-space-in-links* - Spaces inside link text
|
* **[MD039](doc/Rules.md#md039)** *no-space-in-links* - Spaces inside link text
|
||||||
* **[MD040](doc/Rules.md#md040)** *fenced-code-language* - Fenced code blocks should have a language specified
|
* **[MD040](doc/Rules.md#md040)** *fenced-code-language* - Fenced code blocks should have a language specified
|
||||||
* **[MD041](doc/Rules.md#md041)** *first-line-h1* - First line in file should be a top level header
|
* **[MD041](doc/Rules.md#md041)** *first-line-h1* - First line in file should be a top level heading
|
||||||
* **[MD042](doc/Rules.md#md042)** *no-empty-links* - No empty links
|
* **[MD042](doc/Rules.md#md042)** *no-empty-links* - No empty links
|
||||||
* **[MD043](doc/Rules.md#md043)** *required-headers* - Required header structure
|
* **[MD043](doc/Rules.md#md043)** *required-headings, required-headers* - Required heading structure
|
||||||
* **[MD044](doc/Rules.md#md044)** *proper-names* - Proper names should have the correct capitalization
|
* **[MD044](doc/Rules.md#md044)** *proper-names* - Proper names should have the correct capitalization
|
||||||
* **[MD045](doc/Rules.md#md045)** *no-alt-text* - Images should have alternate text (alt text)
|
* **[MD045](doc/Rules.md#md045)** *no-alt-text* - Images should have alternate text (alt text)
|
||||||
|
|
||||||
See [Rules.md](doc/Rules.md) for more details.
|
See [Rules.md](doc/Rules.md) for more details.
|
||||||
|
|
||||||
|
> All rules with `heading` as part of their name are also available as `header`
|
||||||
|
> aliases, e.g. `heading-increment` is also available as `header-increment`.
|
||||||
|
> This is provided for backward compatibility, though its usage is discouraged.
|
||||||
|
|
||||||
## Tags
|
## Tags
|
||||||
|
|
||||||
* **accessibility** - MD045
|
* **accessibility** - MD045
|
||||||
|
@ -101,6 +105,8 @@ See [Rules.md](doc/Rules.md) for more details.
|
||||||
* **code** - MD014, MD031, MD038, MD040
|
* **code** - MD014, MD031, MD038, MD040
|
||||||
* **emphasis** - MD036, MD037
|
* **emphasis** - MD036, MD037
|
||||||
* **hard_tab** - MD010
|
* **hard_tab** - MD010
|
||||||
|
* **headings** - MD001, MD002, MD003, MD018, MD019, MD020, MD021, MD022, MD023,
|
||||||
|
MD024, MD025, MD026, MD036, MD041, MD043
|
||||||
* **headers** - MD001, MD002, MD003, MD018, MD019, MD020, MD021, MD022, MD023,
|
* **headers** - MD001, MD002, MD003, MD018, MD019, MD020, MD021, MD022, MD023,
|
||||||
MD024, MD025, MD026, MD036, MD041, MD043
|
MD024, MD025, MD026, MD036, MD041, MD043
|
||||||
* **hr** - MD035
|
* **hr** - MD035
|
||||||
|
@ -473,13 +479,13 @@ Output:
|
||||||
|
|
||||||
```text
|
```text
|
||||||
bad.string: 3: MD010/no-hard-tabs Hard tabs [Column: 19]
|
bad.string: 3: MD010/no-hard-tabs Hard tabs [Column: 19]
|
||||||
bad.string: 1: MD018/no-missing-space-atx No space after hash on atx style header [Context: "#bad.string"]
|
bad.string: 1: MD018/no-missing-space-atx No space after hash on atx style heading [Context: "#bad.string"]
|
||||||
bad.string: 3: MD018/no-missing-space-atx No space after hash on atx style header [Context: "#This string fails some rules."]
|
bad.string: 3: MD018/no-missing-space-atx No space after hash on atx style heading [Context: "#This string fails some rules."]
|
||||||
bad.string: 1: MD041/first-line-h1 First line in file should be a top level header [Context: "#bad.string"]
|
bad.string: 1: MD041/first-line-h1 First line in file should be a top level heading [Context: "#bad.string"]
|
||||||
bad.md: 3: MD010/no-hard-tabs Hard tabs [Column: 17]
|
bad.md: 3: MD010/no-hard-tabs Hard tabs [Column: 17]
|
||||||
bad.md: 1: MD018/no-missing-space-atx No space after hash on atx style header [Context: "#bad.md"]
|
bad.md: 1: MD018/no-missing-space-atx No space after hash on atx style heading [Context: "#bad.md"]
|
||||||
bad.md: 3: MD018/no-missing-space-atx No space after hash on atx style header [Context: "#This file fails some rules."]
|
bad.md: 3: MD018/no-missing-space-atx No space after hash on atx style heading [Context: "#This file fails some rules."]
|
||||||
bad.md: 1: MD041/first-line-h1 First line in file should be a top level header [Context: "#bad.md"]
|
bad.md: 1: MD041/first-line-h1 First line in file should be a top level heading [Context: "#bad.md"]
|
||||||
```
|
```
|
||||||
|
|
||||||
Or invoke `markdownlint.sync` for a synchronous call:
|
Or invoke `markdownlint.sync` for a synchronous call:
|
||||||
|
@ -513,19 +519,19 @@ Output:
|
||||||
"errorRange": [ 17, 1 ] },
|
"errorRange": [ 17, 1 ] },
|
||||||
{ "lineNumber": 1,
|
{ "lineNumber": 1,
|
||||||
"ruleNames": [ "MD018", "no-missing-space-atx" ],
|
"ruleNames": [ "MD018", "no-missing-space-atx" ],
|
||||||
"ruleDescription": "No space after hash on atx style header",
|
"ruleDescription": "No space after hash on atx style heading",
|
||||||
"errorDetail": null,
|
"errorDetail": null,
|
||||||
"errorContext": "#bad.md",
|
"errorContext": "#bad.md",
|
||||||
"errorRange": [ 1, 2 ] },
|
"errorRange": [ 1, 2 ] },
|
||||||
{ "lineNumber": 3,
|
{ "lineNumber": 3,
|
||||||
"ruleNames": [ "MD018", "no-missing-space-atx" ],
|
"ruleNames": [ "MD018", "no-missing-space-atx" ],
|
||||||
"ruleDescription": "No space after hash on atx style header",
|
"ruleDescription": "No space after hash on atx style heading",
|
||||||
"errorDetail": null,
|
"errorDetail": null,
|
||||||
"errorContext": "#This file fails\tsome rules.",
|
"errorContext": "#This file fails\tsome rules.",
|
||||||
"errorRange": [ 1, 2 ] },
|
"errorRange": [ 1, 2 ] },
|
||||||
{ "lineNumber": 1,
|
{ "lineNumber": 1,
|
||||||
"ruleNames": [ "MD041", "first-line-h1" ],
|
"ruleNames": [ "MD041", "first-line-h1" ],
|
||||||
"ruleDescription": "First line in file should be a top level header",
|
"ruleDescription": "First line in file should be a top level heading",
|
||||||
"errorDetail": null,
|
"errorDetail": null,
|
||||||
"errorContext": "#bad.md",
|
"errorContext": "#bad.md",
|
||||||
"errorRange": null }
|
"errorRange": null }
|
||||||
|
@ -561,9 +567,9 @@ Output:
|
||||||
```text
|
```text
|
||||||
[00:00:00] Starting 'markdownlint'...
|
[00:00:00] Starting 'markdownlint'...
|
||||||
bad.md: 3: MD010/no-hard-tabs Hard tabs [Column: 17]
|
bad.md: 3: MD010/no-hard-tabs Hard tabs [Column: 17]
|
||||||
bad.md: 1: MD018/no-missing-space-atx No space after hash on atx style header [Context: "#bad.md"]
|
bad.md: 1: MD018/no-missing-space-atx No space after hash on atx style heading [Context: "#bad.md"]
|
||||||
bad.md: 3: MD018/no-missing-space-atx No space after hash on atx style header [Context: "#This file fails some rules."]
|
bad.md: 3: MD018/no-missing-space-atx No space after hash on atx style heading [Context: "#This file fails some rules."]
|
||||||
bad.md: 1: MD041/first-line-h1 First line in file should be a top level header [Context: "#bad.md"]
|
bad.md: 1: MD041/first-line-h1 First line in file should be a top level heading [Context: "#bad.md"]
|
||||||
[00:00:00] Finished 'markdownlint' after 10 ms
|
[00:00:00] Finished 'markdownlint' after 10 ms
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -602,9 +608,9 @@ Output:
|
||||||
Running "markdownlint:example" (markdownlint) task
|
Running "markdownlint:example" (markdownlint) task
|
||||||
Warning:
|
Warning:
|
||||||
bad.md: 3: MD010/no-hard-tabs Hard tabs [Column: 17]
|
bad.md: 3: MD010/no-hard-tabs Hard tabs [Column: 17]
|
||||||
bad.md: 1: MD018/no-missing-space-atx No space after hash on atx style header [Context: "#bad.md"]
|
bad.md: 1: MD018/no-missing-space-atx No space after hash on atx style heading [Context: "#bad.md"]
|
||||||
bad.md: 3: MD018/no-missing-space-atx No space after hash on atx style header [Context: "#This file fails some rules."]
|
bad.md: 3: MD018/no-missing-space-atx No space after hash on atx style heading [Context: "#This file fails some rules."]
|
||||||
bad.md: 1: MD041/first-line-h1 First line in file should be a top level header [Context: "#bad.md"]
|
bad.md: 1: MD041/first-line-h1 First line in file should be a top level heading [Context: "#bad.md"]
|
||||||
Use --force to continue.
|
Use --force to continue.
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
286
doc/Rules.md
286
doc/Rules.md
|
@ -6,62 +6,62 @@ versions of the examples.
|
||||||
|
|
||||||
<a name="md001"></a>
|
<a name="md001"></a>
|
||||||
|
|
||||||
## MD001 - Header levels should only increment by one level at a time
|
## MD001 - Heading levels should only increment by one level at a time
|
||||||
|
|
||||||
Tags: headers
|
Tags: headings, headers
|
||||||
|
|
||||||
Aliases: header-increment
|
Aliases: heading-increment, header-increment
|
||||||
|
|
||||||
This rule is triggered when you skip header levels in a markdown document, for
|
This rule is triggered when you skip heading levels in a markdown document, for
|
||||||
example:
|
example:
|
||||||
|
|
||||||
```markdown
|
```markdown
|
||||||
# Header 1
|
# Heading 1
|
||||||
|
|
||||||
### Header 3
|
### Heading 3
|
||||||
|
|
||||||
We skipped out a 2nd level header in this document
|
We skipped out a 2nd level heading in this document
|
||||||
```
|
```
|
||||||
|
|
||||||
When using multiple header levels, nested headers should increase by only one
|
When using multiple heading levels, nested headings should increase by only one
|
||||||
level at a time:
|
level at a time:
|
||||||
|
|
||||||
```markdown
|
```markdown
|
||||||
# Header 1
|
# Heading 1
|
||||||
|
|
||||||
## Header 2
|
## Heading 2
|
||||||
|
|
||||||
### Header 3
|
### Heading 3
|
||||||
|
|
||||||
#### Header 4
|
#### Heading 4
|
||||||
|
|
||||||
## Another Header 2
|
## Another Heading 2
|
||||||
|
|
||||||
### Another Header 3
|
### Another Heading 3
|
||||||
```
|
```
|
||||||
|
|
||||||
<a name="md002"></a>
|
<a name="md002"></a>
|
||||||
|
|
||||||
## MD002 - First header should be a top level header
|
## MD002 - First heading should be a top level heading
|
||||||
|
|
||||||
Tags: headers
|
Tags: headings, headers
|
||||||
|
|
||||||
Aliases: first-header-h1
|
Aliases: first-heading-h1, first-header-h1
|
||||||
|
|
||||||
Parameters: level (number; default 1)
|
Parameters: level (number; default 1)
|
||||||
|
|
||||||
This rule is triggered when the first header in the document isn't a h1 header:
|
This rule is triggered when the first heading in the document isn't a h1 heading:
|
||||||
|
|
||||||
```markdown
|
```markdown
|
||||||
## This isn't a H1 header
|
## This isn't a H1 heading
|
||||||
|
|
||||||
### Another header
|
### Another heading
|
||||||
```
|
```
|
||||||
|
|
||||||
The first header in the document should be a h1 header:
|
The first heading in the document should be a h1 heading:
|
||||||
|
|
||||||
```markdown
|
```markdown
|
||||||
# Start with a H1 header
|
# Start with a H1 heading
|
||||||
|
|
||||||
## Then use a H2 for subsections
|
## Then use a H2 for subsections
|
||||||
```
|
```
|
||||||
|
@ -71,16 +71,16 @@ cases where an h1 is added externally.
|
||||||
|
|
||||||
<a name="md003"></a>
|
<a name="md003"></a>
|
||||||
|
|
||||||
## MD003 - Header style
|
## MD003 - Heading style
|
||||||
|
|
||||||
Tags: headers
|
Tags: headings, headers
|
||||||
|
|
||||||
Aliases: header-style
|
Aliases: heading-style, header-style
|
||||||
|
|
||||||
Parameters: style ("consistent", "atx", "atx_closed", "setext",
|
Parameters: style ("consistent", "atx", "atx_closed", "setext",
|
||||||
"setext_with_atx", "setext_with_atx_closed"; default "consistent")
|
"setext_with_atx", "setext_with_atx_closed"; default "consistent")
|
||||||
|
|
||||||
This rule is triggered when different header styles (atx, setext, and 'closed'
|
This rule is triggered when different heading styles (atx, setext, and 'closed'
|
||||||
atx) are used in the same document:
|
atx) are used in the same document:
|
||||||
|
|
||||||
```markdown
|
```markdown
|
||||||
|
@ -92,7 +92,7 @@ Setext style H1
|
||||||
===============
|
===============
|
||||||
```
|
```
|
||||||
|
|
||||||
Be consistent with the style of header used in a document:
|
Be consistent with the style of heading used in a document:
|
||||||
|
|
||||||
```markdown
|
```markdown
|
||||||
# ATX style H1
|
# ATX style H1
|
||||||
|
@ -101,7 +101,7 @@ Be consistent with the style of header used in a document:
|
||||||
```
|
```
|
||||||
|
|
||||||
The setext_with_atx and setext_with_atx_closed doc styles allow atx-style
|
The setext_with_atx and setext_with_atx_closed doc styles allow atx-style
|
||||||
headers of level 3 or more in documents with setext style headers:
|
headings of level 3 or more in documents with setext style headings:
|
||||||
|
|
||||||
```markdown
|
```markdown
|
||||||
Setext style H1
|
Setext style H1
|
||||||
|
@ -113,7 +113,7 @@ Setext style H2
|
||||||
### ATX style H3
|
### ATX style H3
|
||||||
```
|
```
|
||||||
|
|
||||||
Note: the configured header style can be a specific style to use (atx,
|
Note: the configured heading style can be a specific style to use (atx,
|
||||||
atx_closed, setext, setext_with_atx, setext_with_atx_closed), or simply require
|
atx_closed, setext, setext_with_atx, setext_with_atx_closed), or simply require
|
||||||
that the usage be consistent within the document.
|
that the usage be consistent within the document.
|
||||||
|
|
||||||
|
@ -308,7 +308,7 @@ to allow this:
|
||||||
|
|
||||||
```markdown
|
```markdown
|
||||||
- list item text
|
- list item text
|
||||||
|
|
||||||
list item text
|
list item text
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -416,7 +416,9 @@ Tags: line_length
|
||||||
|
|
||||||
Aliases: line-length
|
Aliases: line-length
|
||||||
|
|
||||||
Parameters: line_length, code_blocks, tables, headers (number; default 80, boolean; default true)
|
Parameters: line_length, code_blocks, tables, headings, headers (number; default 80, boolean; default true)
|
||||||
|
|
||||||
|
> If a `headings` parameter is not provided, `headers` will be checked instead for backward compatibility.
|
||||||
|
|
||||||
This rule is triggered when there are lines that are longer than the
|
This rule is triggered when there are lines that are longer than the
|
||||||
configured line length (default: 80 characters). To fix this, split the line
|
configured line length (default: 80 characters). To fix this, split the line
|
||||||
|
@ -426,8 +428,8 @@ This rule has an exception where there is no whitespace beyond the configured
|
||||||
line length. This allows you to still include items such as long URLs without
|
line length. This allows you to still include items such as long URLs without
|
||||||
being forced to break them in the middle.
|
being forced to break them in the middle.
|
||||||
|
|
||||||
You have the option to exclude this rule for code blocks, tables, or headers.
|
You have the option to exclude this rule for code blocks, tables, or headings.
|
||||||
To do so, set the `code_blocks`, `tables`, or `headers` parameter(s) to false.
|
To do so, set the `code_blocks`, `tables`, or `headings` parameter(s) to false.
|
||||||
|
|
||||||
Code blocks are included in this rule by default since it is often a
|
Code blocks are included in this rule by default since it is often a
|
||||||
requirement for document readability, and tentatively compatible with code
|
requirement for document readability, and tentatively compatible with code
|
||||||
|
@ -478,185 +480,185 @@ for more information.
|
||||||
|
|
||||||
<a name="md018"></a>
|
<a name="md018"></a>
|
||||||
|
|
||||||
## MD018 - No space after hash on atx style header
|
## MD018 - No space after hash on atx style heading
|
||||||
|
|
||||||
Tags: headers, atx, spaces
|
Tags: headings, headers, atx, spaces
|
||||||
|
|
||||||
Aliases: no-missing-space-atx
|
Aliases: no-missing-space-atx
|
||||||
|
|
||||||
This rule is triggered when spaces are missing after the hash characters
|
This rule is triggered when spaces are missing after the hash characters
|
||||||
in an atx style header:
|
in an atx style heading:
|
||||||
|
|
||||||
```markdown
|
```markdown
|
||||||
#Header 1
|
#Heading 1
|
||||||
|
|
||||||
##Header 2
|
##Heading 2
|
||||||
```
|
```
|
||||||
|
|
||||||
To fix this, separate the header text from the hash character by a single
|
To fix this, separate the heading text from the hash character by a single
|
||||||
space:
|
space:
|
||||||
|
|
||||||
```markdown
|
```markdown
|
||||||
# Header 1
|
# Heading 1
|
||||||
|
|
||||||
## Header 2
|
## Heading 2
|
||||||
```
|
```
|
||||||
|
|
||||||
<a name="md019"></a>
|
<a name="md019"></a>
|
||||||
|
|
||||||
## MD019 - Multiple spaces after hash on atx style header
|
## MD019 - Multiple spaces after hash on atx style heading
|
||||||
|
|
||||||
Tags: headers, atx, spaces
|
Tags: headings, headers, atx, spaces
|
||||||
|
|
||||||
Aliases: no-multiple-space-atx
|
Aliases: no-multiple-space-atx
|
||||||
|
|
||||||
This rule is triggered when more than one space is used to separate the
|
This rule is triggered when more than one space is used to separate the
|
||||||
header text from the hash characters in an atx style header:
|
heading text from the hash characters in an atx style heading:
|
||||||
|
|
||||||
```markdown
|
```markdown
|
||||||
# Header 1
|
# Heading 1
|
||||||
|
|
||||||
## Header 2
|
## Heading 2
|
||||||
```
|
```
|
||||||
|
|
||||||
To fix this, separate the header text from the hash character by a single
|
To fix this, separate the heading text from the hash character by a single
|
||||||
space:
|
space:
|
||||||
|
|
||||||
```markdown
|
```markdown
|
||||||
# Header 1
|
# Heading 1
|
||||||
|
|
||||||
## Header 2
|
## Heading 2
|
||||||
```
|
```
|
||||||
|
|
||||||
<a name="md020"></a>
|
<a name="md020"></a>
|
||||||
|
|
||||||
## MD020 - No space inside hashes on closed atx style header
|
## MD020 - No space inside hashes on closed atx style heading
|
||||||
|
|
||||||
Tags: headers, atx_closed, spaces
|
Tags: headings, headers, atx_closed, spaces
|
||||||
|
|
||||||
Aliases: no-missing-space-closed-atx
|
Aliases: no-missing-space-closed-atx
|
||||||
|
|
||||||
This rule is triggered when spaces are missing inside the hash characters
|
This rule is triggered when spaces are missing inside the hash characters
|
||||||
in a closed atx style header:
|
in a closed atx style heading:
|
||||||
|
|
||||||
```markdown
|
```markdown
|
||||||
#Header 1#
|
#Heading 1#
|
||||||
|
|
||||||
##Header 2##
|
##Heading 2##
|
||||||
```
|
```
|
||||||
|
|
||||||
To fix this, separate the header text from the hash character by a single
|
To fix this, separate the heading text from the hash character by a single
|
||||||
space:
|
space:
|
||||||
|
|
||||||
```markdown
|
```markdown
|
||||||
# Header 1 #
|
# Heading 1 #
|
||||||
|
|
||||||
## Header 2 ##
|
## Heading 2 ##
|
||||||
```
|
```
|
||||||
|
|
||||||
Note: this rule will fire if either side of the header is missing spaces.
|
Note: this rule will fire if either side of the heading is missing spaces.
|
||||||
|
|
||||||
<a name="md021"></a>
|
<a name="md021"></a>
|
||||||
|
|
||||||
## MD021 - Multiple spaces inside hashes on closed atx style header
|
## MD021 - Multiple spaces inside hashes on closed atx style heading
|
||||||
|
|
||||||
Tags: headers, atx_closed, spaces
|
Tags: headings, headers, atx_closed, spaces
|
||||||
|
|
||||||
Aliases: no-multiple-space-closed-atx
|
Aliases: no-multiple-space-closed-atx
|
||||||
|
|
||||||
This rule is triggered when more than one space is used to separate the
|
This rule is triggered when more than one space is used to separate the
|
||||||
header text from the hash characters in a closed atx style header:
|
heading text from the hash characters in a closed atx style heading:
|
||||||
|
|
||||||
```markdown
|
```markdown
|
||||||
# Header 1 #
|
# Heading 1 #
|
||||||
|
|
||||||
## Header 2 ##
|
## Heading 2 ##
|
||||||
```
|
```
|
||||||
|
|
||||||
To fix this, separate the header text from the hash character by a single
|
To fix this, separate the heading text from the hash character by a single
|
||||||
space:
|
space:
|
||||||
|
|
||||||
```markdown
|
```markdown
|
||||||
# Header 1 #
|
# Heading 1 #
|
||||||
|
|
||||||
## Header 2 ##
|
## Heading 2 ##
|
||||||
```
|
```
|
||||||
|
|
||||||
Note: this rule will fire if either side of the header contains multiple
|
Note: this rule will fire if either side of the heading contains multiple
|
||||||
spaces.
|
spaces.
|
||||||
|
|
||||||
<a name="md022"></a>
|
<a name="md022"></a>
|
||||||
|
|
||||||
## MD022 - Headers should be surrounded by blank lines
|
## MD022 - Headings should be surrounded by blank lines
|
||||||
|
|
||||||
Tags: headers, blank_lines
|
Tags: headings, headers, blank_lines
|
||||||
|
|
||||||
Aliases: blanks-around-headers
|
Aliases: blanks-around-headings, blanks-around-headers
|
||||||
|
|
||||||
This rule is triggered when headers (any style) are either not preceded or not
|
This rule is triggered when headings (any style) are either not preceded or not
|
||||||
followed by a blank line:
|
followed by a blank line:
|
||||||
|
|
||||||
```markdown
|
```markdown
|
||||||
# Header 1
|
# Heading 1
|
||||||
Some text
|
Some text
|
||||||
|
|
||||||
Some more text
|
Some more text
|
||||||
## Header 2
|
## Heading 2
|
||||||
```
|
```
|
||||||
|
|
||||||
To fix this, ensure that all headers have a blank line both before and after
|
To fix this, ensure that all headings have a blank line both before and after
|
||||||
(except where the header is at the beginning or end of the document):
|
(except where the heading is at the beginning or end of the document):
|
||||||
|
|
||||||
```markdown
|
```markdown
|
||||||
# Header 1
|
# Heading 1
|
||||||
|
|
||||||
Some text
|
Some text
|
||||||
|
|
||||||
Some more text
|
Some more text
|
||||||
|
|
||||||
## Header 2
|
## Heading 2
|
||||||
```
|
```
|
||||||
|
|
||||||
Rationale: Aside from aesthetic reasons, some parsers, including kramdown, will
|
Rationale: Aside from aesthetic reasons, some parsers, including kramdown, will
|
||||||
not parse headers that don't have a blank line before, and will parse them as
|
not parse headings that don't have a blank line before, and will parse them as
|
||||||
regular text.
|
regular text.
|
||||||
|
|
||||||
<a name="md023"></a>
|
<a name="md023"></a>
|
||||||
|
|
||||||
## MD023 - Headers must start at the beginning of the line
|
## MD023 - Headings must start at the beginning of the line
|
||||||
|
|
||||||
Tags: headers, spaces
|
Tags: headings, headers, spaces
|
||||||
|
|
||||||
Aliases: header-start-left
|
Aliases: heading-start-left, header-start-left
|
||||||
|
|
||||||
This rule is triggered when a header is indented by one or more spaces:
|
This rule is triggered when a heading is indented by one or more spaces:
|
||||||
|
|
||||||
```markdown
|
```markdown
|
||||||
Some text
|
Some text
|
||||||
|
|
||||||
# Indented header
|
# Indented heading
|
||||||
```
|
```
|
||||||
|
|
||||||
To fix this, ensure that all headers start at the beginning of the line:
|
To fix this, ensure that all headings start at the beginning of the line:
|
||||||
|
|
||||||
```markdown
|
```markdown
|
||||||
Some text
|
Some text
|
||||||
|
|
||||||
# Header
|
# Heading
|
||||||
```
|
```
|
||||||
|
|
||||||
Rationale: Headers that don't start at the beginning of the line will not be
|
Rationale: Headings that don't start at the beginning of the line will not be
|
||||||
parsed as headers, and will instead appear as regular text.
|
parsed as headings, and will instead appear as regular text.
|
||||||
|
|
||||||
<a name="md024"></a>
|
<a name="md024"></a>
|
||||||
|
|
||||||
## MD024 - Multiple headers with the same content
|
## MD024 - Multiple headings with the same content
|
||||||
|
|
||||||
Tags: headers
|
Tags: headings, headers
|
||||||
|
|
||||||
Aliases: no-duplicate-header
|
Aliases: no-duplicate-heading, no-duplicate-header
|
||||||
|
|
||||||
This rule is triggered if there are multiple headers in the document that have
|
This rule is triggered if there are multiple headings in the document that have
|
||||||
the same text:
|
the same text:
|
||||||
|
|
||||||
```markdown
|
```markdown
|
||||||
|
@ -665,7 +667,7 @@ the same text:
|
||||||
## Some text
|
## Some text
|
||||||
```
|
```
|
||||||
|
|
||||||
To fix this, ensure that the content of each header is different:
|
To fix this, ensure that the content of each heading is different:
|
||||||
|
|
||||||
```markdown
|
```markdown
|
||||||
# Some text
|
# Some text
|
||||||
|
@ -673,76 +675,76 @@ To fix this, ensure that the content of each header is different:
|
||||||
## Some more text
|
## Some more text
|
||||||
```
|
```
|
||||||
|
|
||||||
Rationale: Some markdown parses generate anchors for headers based on the
|
Rationale: Some markdown parses generate anchors for headings based on the
|
||||||
header name, and having headers with the same content can cause problems with
|
heading name, and having headings with the same content can cause problems with
|
||||||
this.
|
this.
|
||||||
|
|
||||||
<a name="md025"></a>
|
<a name="md025"></a>
|
||||||
|
|
||||||
## MD025 - Multiple top level headers in the same document
|
## MD025 - Multiple top level headings in the same document
|
||||||
|
|
||||||
Tags: headers
|
Tags: headings, headers
|
||||||
|
|
||||||
Aliases: single-h1
|
Aliases: single-h1
|
||||||
|
|
||||||
Parameters: level (number; default 1)
|
Parameters: level (number; default 1)
|
||||||
|
|
||||||
This rule is triggered when a top level header is in use (the first line of
|
This rule is triggered when a top level heading is in use (the first line of
|
||||||
the file is a h1 header), and more than one h1 header is in use in the
|
the file is a h1 heading), and more than one h1 heading is in use in the
|
||||||
document:
|
document:
|
||||||
|
|
||||||
```markdown
|
```markdown
|
||||||
# Top level header
|
# Top level heading
|
||||||
|
|
||||||
# Another top level header
|
# Another top level heading
|
||||||
```
|
```
|
||||||
|
|
||||||
To fix, structure your document so that there is a single h1 header that is
|
To fix, structure your document so that there is a single h1 heading that is
|
||||||
the title for the document, and all later headers are h2 or lower level
|
the title for the document, and all later headings are h2 or lower level
|
||||||
headers:
|
headings:
|
||||||
|
|
||||||
```markdown
|
```markdown
|
||||||
# Title
|
# Title
|
||||||
|
|
||||||
## Header
|
## Heading
|
||||||
|
|
||||||
## Another header
|
## Another heading
|
||||||
```
|
```
|
||||||
|
|
||||||
Rationale: A top level header is a h1 on the first line of the file, and
|
Rationale: A top level heading is a h1 on the first line of the file, and
|
||||||
serves as the title for the document. If this convention is in use, then there
|
serves as the title for the document. If this convention is in use, then there
|
||||||
can not be more than one title for the document, and the entire document
|
can not be more than one title for the document, and the entire document
|
||||||
should be contained within this header.
|
should be contained within this heading.
|
||||||
|
|
||||||
Note: The `level` parameter can be used to change the top level (ex: to h2) in
|
Note: The `level` parameter can be used to change the top level (ex: to h2) in
|
||||||
cases where an h1 is added externally.
|
cases where an h1 is added externally.
|
||||||
|
|
||||||
<a name="md026"></a>
|
<a name="md026"></a>
|
||||||
|
|
||||||
## MD026 - Trailing punctuation in header
|
## MD026 - Trailing punctuation in heading
|
||||||
|
|
||||||
Tags: headers
|
Tags: headings, headers
|
||||||
|
|
||||||
Aliases: no-trailing-punctuation
|
Aliases: no-trailing-punctuation
|
||||||
|
|
||||||
Parameters: punctuation (string; default ".,;:!?")
|
Parameters: punctuation (string; default ".,;:!?")
|
||||||
|
|
||||||
This rule is triggered on any header that has a punctuation character as the
|
This rule is triggered on any heading that has a punctuation character as the
|
||||||
last character in the line:
|
last character in the line:
|
||||||
|
|
||||||
```markdown
|
```markdown
|
||||||
# This is a header.
|
# This is a heading.
|
||||||
```
|
```
|
||||||
|
|
||||||
To fix this, remove any trailing punctuation:
|
To fix this, remove any trailing punctuation:
|
||||||
|
|
||||||
```markdown
|
```markdown
|
||||||
# This is a header
|
# This is a heading
|
||||||
```
|
```
|
||||||
|
|
||||||
Note: The punctuation parameter can be used to specify what characters class
|
Note: The punctuation parameter can be used to specify what characters class
|
||||||
as punctuation at the end of the header. For example, you can set it to
|
as punctuation at the end of the heading. For example, you can set it to
|
||||||
`".,;:!"` to allow headers with question marks in them, such as might be used
|
`".,;:!"` to allow headings with question marks in them, such as might be used
|
||||||
in an FAQ.
|
in an FAQ.
|
||||||
|
|
||||||
<a name="md027"></a>
|
<a name="md027"></a>
|
||||||
|
@ -1027,13 +1029,13 @@ Parameters: allowed_elements (array of string; default empty)
|
||||||
This rule is triggered whenever raw HTML is used in a markdown document:
|
This rule is triggered whenever raw HTML is used in a markdown document:
|
||||||
|
|
||||||
```markdown
|
```markdown
|
||||||
<h1>Inline HTML header</h1>
|
<h1>Inline HTML heading</h1>
|
||||||
```
|
```
|
||||||
|
|
||||||
To fix this, use 'pure' markdown instead of including raw HTML:
|
To fix this, use 'pure' markdown instead of including raw HTML:
|
||||||
|
|
||||||
```markdown
|
```markdown
|
||||||
# Markdown header
|
# Markdown heading
|
||||||
```
|
```
|
||||||
|
|
||||||
Rationale: Raw HTML is allowed in markdown, but this rule is included for
|
Rationale: Raw HTML is allowed in markdown, but this rule is included for
|
||||||
|
@ -1118,16 +1120,16 @@ is allowed.
|
||||||
|
|
||||||
<a name="md036"></a>
|
<a name="md036"></a>
|
||||||
|
|
||||||
## MD036 - Emphasis used instead of a header
|
## MD036 - Emphasis used instead of a heading
|
||||||
|
|
||||||
Tags: headers, emphasis
|
Tags: headings, headers, emphasis
|
||||||
|
|
||||||
Aliases: no-emphasis-as-header
|
Aliases: no-emphasis-as-heading, no-emphasis-as-header
|
||||||
|
|
||||||
Parameters: punctuation (string; default ".,;:!?")
|
Parameters: punctuation (string; default ".,;:!?")
|
||||||
|
|
||||||
This check looks for instances where emphasized (i.e. bold or italic) text is
|
This check looks for instances where emphasized (i.e. bold or italic) text is
|
||||||
used to separate sections, where a header should be used instead:
|
used to separate sections, where a heading should be used instead:
|
||||||
|
|
||||||
```markdown
|
```markdown
|
||||||
**My document**
|
**My document**
|
||||||
|
@ -1139,7 +1141,7 @@ _Another section_
|
||||||
Consectetur adipiscing elit, sed do eiusmod.
|
Consectetur adipiscing elit, sed do eiusmod.
|
||||||
```
|
```
|
||||||
|
|
||||||
To fix this, use markdown headers instead of emphasized text to denote
|
To fix this, use markdown headings instead of emphasized text to denote
|
||||||
sections:
|
sections:
|
||||||
|
|
||||||
```markdown
|
```markdown
|
||||||
|
@ -1277,27 +1279,27 @@ echo Hello world
|
||||||
|
|
||||||
<a name="md041"></a>
|
<a name="md041"></a>
|
||||||
|
|
||||||
## MD041 - First line in file should be a top level header
|
## MD041 - First line in file should be a top level heading
|
||||||
|
|
||||||
Tags: headers
|
Tags: headings, headers
|
||||||
|
|
||||||
Aliases: first-line-h1
|
Aliases: first-line-h1
|
||||||
|
|
||||||
Parameters: level, front_matter_title (number; default 1, string; default "^\s*title:")
|
Parameters: level, front_matter_title (number; default 1, string; default "^\s*title:")
|
||||||
|
|
||||||
This rule is triggered when the first line in the file isn't a top level (h1)
|
This rule is triggered when the first line in the file isn't a top level (h1)
|
||||||
header:
|
heading:
|
||||||
|
|
||||||
```markdown
|
```markdown
|
||||||
This is a file without a header
|
This is a file without a heading
|
||||||
```
|
```
|
||||||
|
|
||||||
To fix this, add a header to the top of your file:
|
To fix this, add a heading to the top of your file:
|
||||||
|
|
||||||
```markdown
|
```markdown
|
||||||
# File with header
|
# File with heading
|
||||||
|
|
||||||
This is a file with a top level header
|
This is a file with a top level heading
|
||||||
```
|
```
|
||||||
|
|
||||||
The `level` parameter can be used to change the top level (ex: to h2) in cases
|
The `level` parameter can be used to change the top level (ex: to h2) in cases
|
||||||
|
@ -1343,16 +1345,18 @@ But non-empty fragments will not:
|
||||||
|
|
||||||
<a name="md043"></a>
|
<a name="md043"></a>
|
||||||
|
|
||||||
## MD043 - Required header structure
|
## MD043 - Required heading structure
|
||||||
|
|
||||||
Tags: headers
|
Tags: headings, headers
|
||||||
|
|
||||||
Aliases: required-headers
|
Aliases: required-headings, required-headers
|
||||||
|
|
||||||
Parameters: headers (array of string; default `null` for disabled)
|
Parameters: headings, headers (array of string; default `null` for disabled)
|
||||||
|
|
||||||
This rule is triggered when the headers in a file do not match the array of
|
> If a `headings` parameter is not provided, `headers` will be checked instead for backward compatibility.
|
||||||
headers passed to the rule. It can be used to enforce a standard header
|
|
||||||
|
This rule is triggered when the headings in a file do not match the array of
|
||||||
|
headings passed to the rule. It can be used to enforce a standard heading
|
||||||
structure for a set of files.
|
structure for a set of files.
|
||||||
|
|
||||||
To require exactly the following structure:
|
To require exactly the following structure:
|
||||||
|
@ -1363,7 +1367,7 @@ To require exactly the following structure:
|
||||||
### Detail
|
### Detail
|
||||||
```
|
```
|
||||||
|
|
||||||
Set the `headers` parameter to:
|
Set the `headings` parameter to:
|
||||||
|
|
||||||
```json
|
```json
|
||||||
[
|
[
|
||||||
|
@ -1373,7 +1377,7 @@ Set the `headers` parameter to:
|
||||||
]
|
]
|
||||||
```
|
```
|
||||||
|
|
||||||
To allow optional headers as with the following structure:
|
To allow optional headings as with the following structure:
|
||||||
|
|
||||||
```markdown
|
```markdown
|
||||||
# Head
|
# Head
|
||||||
|
@ -1383,8 +1387,8 @@ To allow optional headers as with the following structure:
|
||||||
### Notes (optional)
|
### Notes (optional)
|
||||||
```
|
```
|
||||||
|
|
||||||
Use the special value `"*"` meaning "one or more unspecified headers" and set
|
Use the special value `"*"` meaning "one or more unspecified headings" and set
|
||||||
the `headers` parameter to:
|
the `headings` parameter to:
|
||||||
|
|
||||||
```json
|
```json
|
||||||
[
|
[
|
||||||
|
@ -1397,10 +1401,10 @@ the `headers` parameter to:
|
||||||
```
|
```
|
||||||
|
|
||||||
When an error is detected, this rule outputs the line number of the first
|
When an error is detected, this rule outputs the line number of the first
|
||||||
problematic header (otherwise, it outputs the last line number of the file).
|
problematic heading (otherwise, it outputs the last line number of the file).
|
||||||
|
|
||||||
Note that while the `headers` parameter uses the "## Text" ATX header style for
|
Note that while the `headings` parameter uses the "## Text" ATX heading style for
|
||||||
simplicity, a file may use any supported header style.
|
simplicity, a file may use any supported heading style.
|
||||||
|
|
||||||
<a name="md044"></a>
|
<a name="md044"></a>
|
||||||
|
|
||||||
|
|
|
@ -5,9 +5,9 @@
|
||||||
var shared = require("./shared");
|
var shared = require("./shared");
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
"names": [ "MD001", "header-increment" ],
|
"names": [ "MD001", "heading-increment", "header-increment" ],
|
||||||
"description": "Header levels should only increment by one level at a time",
|
"description": "Heading levels should only increment by one level at a time",
|
||||||
"tags": [ "headers" ],
|
"tags": [ "headings", "headers" ],
|
||||||
"function": function MD001(params, onError) {
|
"function": function MD001(params, onError) {
|
||||||
var prevLevel = 0;
|
var prevLevel = 0;
|
||||||
shared.filterTokens(params, "heading_open", function forToken(token) {
|
shared.filterTokens(params, "heading_open", function forToken(token) {
|
||||||
|
|
|
@ -5,9 +5,9 @@
|
||||||
var shared = require("./shared");
|
var shared = require("./shared");
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
"names": [ "MD002", "first-header-h1" ],
|
"names": [ "MD002", "first-heading-h1", "first-header-h1" ],
|
||||||
"description": "First header should be a top level header",
|
"description": "First heading should be a top level heading",
|
||||||
"tags": [ "headers" ],
|
"tags": [ "headings", "headers" ],
|
||||||
"function": function MD002(params, onError) {
|
"function": function MD002(params, onError) {
|
||||||
var level = params.config.level || 1;
|
var level = params.config.level || 1;
|
||||||
var tag = "h" + level;
|
var tag = "h" + level;
|
||||||
|
|
|
@ -5,9 +5,9 @@
|
||||||
var shared = require("./shared");
|
var shared = require("./shared");
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
"names": [ "MD003", "header-style" ],
|
"names": [ "MD003", "heading-style", "header-style" ],
|
||||||
"description": "Header style",
|
"description": "Heading style",
|
||||||
"tags": [ "headers" ],
|
"tags": [ "headings", "headers" ],
|
||||||
"function": function MD003(params, onError) {
|
"function": function MD003(params, onError) {
|
||||||
var style = params.config.style || "consistent";
|
var style = params.config.style || "consistent";
|
||||||
shared.filterTokens(params, "heading_open", function forToken(token) {
|
shared.filterTokens(params, "heading_open", function forToken(token) {
|
||||||
|
|
15
lib/md013.js
15
lib/md013.js
|
@ -16,12 +16,15 @@ module.exports = {
|
||||||
var includeCodeBlocks = (codeBlocks === undefined) ? true : !!codeBlocks;
|
var includeCodeBlocks = (codeBlocks === undefined) ? true : !!codeBlocks;
|
||||||
var tables = params.config.tables;
|
var tables = params.config.tables;
|
||||||
var includeTables = (tables === undefined) ? true : !!tables;
|
var includeTables = (tables === undefined) ? true : !!tables;
|
||||||
var headers = params.config.headers;
|
var headings = params.config.headings;
|
||||||
var includeHeaders = (headers === undefined) ? true : !!headers;
|
if (headings === undefined) {
|
||||||
var headerLineNumbers = [];
|
headings = params.config.headers;
|
||||||
if (!includeHeaders) {
|
}
|
||||||
|
var includeHeadings = (headings === undefined) ? true : !!headings;
|
||||||
|
var headingLineNumbers = [];
|
||||||
|
if (!includeHeadings) {
|
||||||
shared.forEachHeading(params, function forHeading(heading) {
|
shared.forEachHeading(params, function forHeading(heading) {
|
||||||
headerLineNumbers.push(heading.lineNumber);
|
headingLineNumbers.push(heading.lineNumber);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
var tokenTypeMap = {
|
var tokenTypeMap = {
|
||||||
|
@ -51,7 +54,7 @@ module.exports = {
|
||||||
var lineNumber = lineIndex + 1;
|
var lineNumber = lineIndex + 1;
|
||||||
if ((includeCodeBlocks || !inCode) &&
|
if ((includeCodeBlocks || !inCode) &&
|
||||||
(includeTables || !inTable) &&
|
(includeTables || !inTable) &&
|
||||||
(includeHeaders || (headerLineNumbers.indexOf(lineNumber)) < 0) &&
|
(includeHeadings || (headingLineNumbers.indexOf(lineNumber)) < 0) &&
|
||||||
(linkOnlyLineNumbers.indexOf(lineNumber) < 0) &&
|
(linkOnlyLineNumbers.indexOf(lineNumber) < 0) &&
|
||||||
longLineRe.test(line) &&
|
longLineRe.test(line) &&
|
||||||
!labelRe.test(line)) {
|
!labelRe.test(line)) {
|
||||||
|
|
|
@ -6,13 +6,13 @@ var shared = require("./shared");
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
"names": [ "MD018", "no-missing-space-atx" ],
|
"names": [ "MD018", "no-missing-space-atx" ],
|
||||||
"description": "No space after hash on atx style header",
|
"description": "No space after hash on atx style heading",
|
||||||
"tags": [ "headers", "atx", "spaces" ],
|
"tags": [ "headings", "headers", "atx", "spaces" ],
|
||||||
"function": function MD018(params, onError) {
|
"function": function MD018(params, onError) {
|
||||||
shared.forEachLine(function forLine(line, lineIndex, inCode) {
|
shared.forEachLine(function forLine(line, lineIndex, inCode) {
|
||||||
if (!inCode && /^#+[^#\s]/.test(line) && !/#$/.test(line)) {
|
if (!inCode && /^#+[^#\s]/.test(line) && !/#$/.test(line)) {
|
||||||
shared.addErrorContext(onError, lineIndex + 1, line.trim(), null,
|
shared.addErrorContext(onError, lineIndex + 1, line.trim(), null,
|
||||||
null, shared.rangeFromRegExp(line, shared.atxHeaderSpaceRe));
|
null, shared.rangeFromRegExp(line, shared.atxHeadingSpaceRe));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,15 +6,15 @@ var shared = require("./shared");
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
"names": [ "MD019", "no-multiple-space-atx" ],
|
"names": [ "MD019", "no-multiple-space-atx" ],
|
||||||
"description": "Multiple spaces after hash on atx style header",
|
"description": "Multiple spaces after hash on atx style heading",
|
||||||
"tags": [ "headers", "atx", "spaces" ],
|
"tags": [ "headings", "headers", "atx", "spaces" ],
|
||||||
"function": function MD019(params, onError) {
|
"function": function MD019(params, onError) {
|
||||||
shared.filterTokens(params, "heading_open", function forToken(token) {
|
shared.filterTokens(params, "heading_open", function forToken(token) {
|
||||||
if ((shared.headingStyleFor(token) === "atx") &&
|
if ((shared.headingStyleFor(token) === "atx") &&
|
||||||
/^#+\s\s/.test(token.line)) {
|
/^#+\s\s/.test(token.line)) {
|
||||||
shared.addErrorContext(onError, token.lineNumber, token.line.trim(),
|
shared.addErrorContext(onError, token.lineNumber, token.line.trim(),
|
||||||
null, null,
|
null, null,
|
||||||
shared.rangeFromRegExp(token.line, shared.atxHeaderSpaceRe));
|
shared.rangeFromRegExp(token.line, shared.atxHeadingSpaceRe));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,12 +4,12 @@
|
||||||
|
|
||||||
var shared = require("./shared");
|
var shared = require("./shared");
|
||||||
|
|
||||||
var atxClosedHeaderNoSpaceRe = /(?:^#+[^#\s])|(?:[^#\s]#+\s*$)/;
|
var atxClosedHeadingNoSpaceRe = /(?:^#+[^#\s])|(?:[^#\s]#+\s*$)/;
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
"names": [ "MD020", "no-missing-space-closed-atx" ],
|
"names": [ "MD020", "no-missing-space-closed-atx" ],
|
||||||
"description": "No space inside hashes on closed atx style header",
|
"description": "No space inside hashes on closed atx style heading",
|
||||||
"tags": [ "headers", "atx_closed", "spaces" ],
|
"tags": [ "headings", "headers", "atx_closed", "spaces" ],
|
||||||
"function": function MD020(params, onError) {
|
"function": function MD020(params, onError) {
|
||||||
shared.forEachLine(function forLine(line, lineIndex, inCode) {
|
shared.forEachLine(function forLine(line, lineIndex, inCode) {
|
||||||
if (!inCode && /^#+[^#]*[^\\]#+$/.test(line)) {
|
if (!inCode && /^#+[^#]*[^\\]#+$/.test(line)) {
|
||||||
|
@ -17,7 +17,7 @@ module.exports = {
|
||||||
var right = /[^#\s]#+$/.test(line);
|
var right = /[^#\s]#+$/.test(line);
|
||||||
if (left || right) {
|
if (left || right) {
|
||||||
shared.addErrorContext(onError, lineIndex + 1, line.trim(), left,
|
shared.addErrorContext(onError, lineIndex + 1, line.trim(), left,
|
||||||
right, shared.rangeFromRegExp(line, atxClosedHeaderNoSpaceRe));
|
right, shared.rangeFromRegExp(line, atxClosedHeadingNoSpaceRe));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -4,12 +4,12 @@
|
||||||
|
|
||||||
var shared = require("./shared");
|
var shared = require("./shared");
|
||||||
|
|
||||||
var atxClosedHeaderSpaceRe = /(?:^#+\s\s+?\S)|(?:\S\s\s+?#+\s*$)/;
|
var atxClosedHeadingSpaceRe = /(?:^#+\s\s+?\S)|(?:\S\s\s+?#+\s*$)/;
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
"names": [ "MD021", "no-multiple-space-closed-atx" ],
|
"names": [ "MD021", "no-multiple-space-closed-atx" ],
|
||||||
"description": "Multiple spaces inside hashes on closed atx style header",
|
"description": "Multiple spaces inside hashes on closed atx style heading",
|
||||||
"tags": [ "headers", "atx_closed", "spaces" ],
|
"tags": [ "headings", "headers", "atx_closed", "spaces" ],
|
||||||
"function": function MD021(params, onError) {
|
"function": function MD021(params, onError) {
|
||||||
shared.filterTokens(params, "heading_open", function forToken(token) {
|
shared.filterTokens(params, "heading_open", function forToken(token) {
|
||||||
if (shared.headingStyleFor(token) === "atx_closed") {
|
if (shared.headingStyleFor(token) === "atx_closed") {
|
||||||
|
@ -18,7 +18,7 @@ module.exports = {
|
||||||
if (left || right) {
|
if (left || right) {
|
||||||
shared.addErrorContext(onError, token.lineNumber, token.line.trim(),
|
shared.addErrorContext(onError, token.lineNumber, token.line.trim(),
|
||||||
left, right,
|
left, right,
|
||||||
shared.rangeFromRegExp(token.line, atxClosedHeaderSpaceRe));
|
shared.rangeFromRegExp(token.line, atxClosedHeadingSpaceRe));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -5,9 +5,9 @@
|
||||||
var shared = require("./shared");
|
var shared = require("./shared");
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
"names": [ "MD022", "blanks-around-headers" ],
|
"names": [ "MD022", "blanks-around-headings", "blanks-around-headers" ],
|
||||||
"description": "Headers should be surrounded by blank lines",
|
"description": "Headings should be surrounded by blank lines",
|
||||||
"tags": [ "headers", "blank_lines" ],
|
"tags": [ "headings", "headers", "blank_lines" ],
|
||||||
"function": function MD022(params, onError) {
|
"function": function MD022(params, onError) {
|
||||||
var prevHeadingLineNumber = 0;
|
var prevHeadingLineNumber = 0;
|
||||||
var prevMaxLineIndex = -1;
|
var prevMaxLineIndex = -1;
|
||||||
|
|
12
lib/md023.js
12
lib/md023.js
|
@ -4,17 +4,17 @@
|
||||||
|
|
||||||
var shared = require("./shared");
|
var shared = require("./shared");
|
||||||
|
|
||||||
var spaceBeforeHeaderRe = /^\s+\S/;
|
var spaceBeforeHeadingRe = /^\s+\S/;
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
"names": [ "MD023", "header-start-left" ],
|
"names": [ "MD023", "heading-start-left", "header-start-left" ],
|
||||||
"description": "Headers must start at the beginning of the line",
|
"description": "Headings must start at the beginning of the line",
|
||||||
"tags": [ "headers", "spaces" ],
|
"tags": [ "headings", "headers", "spaces" ],
|
||||||
"function": function MD023(params, onError) {
|
"function": function MD023(params, onError) {
|
||||||
shared.filterTokens(params, "heading_open", function forToken(token) {
|
shared.filterTokens(params, "heading_open", function forToken(token) {
|
||||||
if (spaceBeforeHeaderRe.test(token.line)) {
|
if (spaceBeforeHeadingRe.test(token.line)) {
|
||||||
shared.addErrorContext(onError, token.lineNumber, token.line, null,
|
shared.addErrorContext(onError, token.lineNumber, token.line, null,
|
||||||
null, shared.rangeFromRegExp(token.line, spaceBeforeHeaderRe));
|
null, shared.rangeFromRegExp(token.line, spaceBeforeHeadingRe));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,9 +5,9 @@
|
||||||
var shared = require("./shared");
|
var shared = require("./shared");
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
"names": [ "MD024", "no-duplicate-header" ],
|
"names": [ "MD024", "no-duplicate-heading", "no-duplicate-header" ],
|
||||||
"description": "Multiple headers with the same content",
|
"description": "Multiple headings with the same content",
|
||||||
"tags": [ "headers" ],
|
"tags": [ "headings", "headers" ],
|
||||||
"function": function MD024(params, onError) {
|
"function": function MD024(params, onError) {
|
||||||
var knownContent = [];
|
var knownContent = [];
|
||||||
shared.forEachHeading(params, function forHeading(heading, content) {
|
shared.forEachHeading(params, function forHeading(heading, content) {
|
||||||
|
|
|
@ -6,8 +6,8 @@ var shared = require("./shared");
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
"names": [ "MD025", "single-h1" ],
|
"names": [ "MD025", "single-h1" ],
|
||||||
"description": "Multiple top level headers in the same document",
|
"description": "Multiple top level headings in the same document",
|
||||||
"tags": [ "headers" ],
|
"tags": [ "headings", "headers" ],
|
||||||
"function": function MD025(params, onError) {
|
"function": function MD025(params, onError) {
|
||||||
var level = params.config.level || 1;
|
var level = params.config.level || 1;
|
||||||
var tag = "h" + level;
|
var tag = "h" + level;
|
||||||
|
|
|
@ -6,8 +6,8 @@ var shared = require("./shared");
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
"names": [ "MD026", "no-trailing-punctuation" ],
|
"names": [ "MD026", "no-trailing-punctuation" ],
|
||||||
"description": "Trailing punctuation in header",
|
"description": "Trailing punctuation in heading",
|
||||||
"tags": [ "headers" ],
|
"tags": [ "headings", "headers" ],
|
||||||
"function": function MD026(params, onError) {
|
"function": function MD026(params, onError) {
|
||||||
var punctuation = params.config.punctuation || ".,;:!?";
|
var punctuation = params.config.punctuation || ".,;:!?";
|
||||||
var trailingPunctuationRe = new RegExp("[" + punctuation + "]$");
|
var trailingPunctuationRe = new RegExp("[" + punctuation + "]$");
|
||||||
|
|
|
@ -5,9 +5,9 @@
|
||||||
var shared = require("./shared");
|
var shared = require("./shared");
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
"names": [ "MD036", "no-emphasis-as-header" ],
|
"names": [ "MD036", "no-emphasis-as-heading", "no-emphasis-as-header" ],
|
||||||
"description": "Emphasis used instead of a header",
|
"description": "Emphasis used instead of a heading",
|
||||||
"tags": [ "headers", "emphasis" ],
|
"tags": [ "headings", "headers", "emphasis" ],
|
||||||
"function": function MD036(params, onError) {
|
"function": function MD036(params, onError) {
|
||||||
var punctuation = params.config.punctuation || ".,;:!?";
|
var punctuation = params.config.punctuation || ".,;:!?";
|
||||||
var re = new RegExp("[" + punctuation + "]$");
|
var re = new RegExp("[" + punctuation + "]$");
|
||||||
|
|
|
@ -6,8 +6,8 @@ var shared = require("./shared");
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
"names": [ "MD041", "first-line-h1" ],
|
"names": [ "MD041", "first-line-h1" ],
|
||||||
"description": "First line in file should be a top level header",
|
"description": "First line in file should be a top level heading",
|
||||||
"tags": [ "headers" ],
|
"tags": [ "headings", "headers" ],
|
||||||
"function": function MD041(params, onError) {
|
"function": function MD041(params, onError) {
|
||||||
var level = params.config.level || 1;
|
var level = params.config.level || 1;
|
||||||
var frontMatterTitle = params.config.front_matter_title;
|
var frontMatterTitle = params.config.front_matter_title;
|
||||||
|
|
16
lib/md043.js
16
lib/md043.js
|
@ -5,12 +5,12 @@
|
||||||
var shared = require("./shared");
|
var shared = require("./shared");
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
"names": [ "MD043", "required-headers" ],
|
"names": [ "MD043", "required-headings", "required-headers" ],
|
||||||
"description": "Required header structure",
|
"description": "Required heading structure",
|
||||||
"tags": [ "headers" ],
|
"tags": [ "headings", "headers" ],
|
||||||
"function": function MD043(params, onError) {
|
"function": function MD043(params, onError) {
|
||||||
var requiredHeaders = params.config.headers;
|
var requiredHeadings = params.config.headings || params.config.headers;
|
||||||
if (requiredHeaders) {
|
if (requiredHeadings) {
|
||||||
var levels = {};
|
var levels = {};
|
||||||
[ 1, 2, 3, 4, 5, 6 ].forEach(function forLevel(level) {
|
[ 1, 2, 3, 4, 5, 6 ].forEach(function forLevel(level) {
|
||||||
levels["h" + level] = "######".substr(-level);
|
levels["h" + level] = "######".substr(-level);
|
||||||
|
@ -21,7 +21,7 @@ module.exports = {
|
||||||
shared.forEachHeading(params, function forHeading(heading, content) {
|
shared.forEachHeading(params, function forHeading(heading, content) {
|
||||||
if (!errorCount) {
|
if (!errorCount) {
|
||||||
var actual = levels[heading.tag] + " " + content;
|
var actual = levels[heading.tag] + " " + content;
|
||||||
var expected = requiredHeaders[i++] || "[None]";
|
var expected = requiredHeadings[i++] || "[None]";
|
||||||
if (expected === "*") {
|
if (expected === "*") {
|
||||||
optional = true;
|
optional = true;
|
||||||
} else if (expected.toLowerCase() === actual.toLowerCase()) {
|
} else if (expected.toLowerCase() === actual.toLowerCase()) {
|
||||||
|
@ -35,9 +35,9 @@ module.exports = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if ((i < requiredHeaders.length) && !errorCount) {
|
if ((i < requiredHeadings.length) && !errorCount) {
|
||||||
shared.addErrorContext(onError, params.lines.length,
|
shared.addErrorContext(onError, params.lines.length,
|
||||||
requiredHeaders[i]);
|
requiredHeadings[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,7 @@ var inlineCommentRe =
|
||||||
module.exports.inlineCommentRe = inlineCommentRe;
|
module.exports.inlineCommentRe = inlineCommentRe;
|
||||||
|
|
||||||
// Regular expressions for range matching
|
// Regular expressions for range matching
|
||||||
module.exports.atxHeaderSpaceRe = /^#+\s*\S/;
|
module.exports.atxHeadingSpaceRe = /^#+\s*\S/;
|
||||||
module.exports.bareUrlRe = /(?:http|ftp)s?:\/\/[^\s]*/i;
|
module.exports.bareUrlRe = /(?:http|ftp)s?:\/\/[^\s]*/i;
|
||||||
module.exports.listItemMarkerRe = /^[\s>]*(?:[*+-]|\d+\.)\s+/;
|
module.exports.listItemMarkerRe = /^[\s>]*(?:[*+-]|\d+\.)\s+/;
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,7 @@ rules.forEach(function forRule(rule) {
|
||||||
case "MD025":
|
case "MD025":
|
||||||
scheme.properties = {
|
scheme.properties = {
|
||||||
"level": {
|
"level": {
|
||||||
"description": "Header level",
|
"description": "Heading level",
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
"default": 1
|
"default": 1
|
||||||
}
|
}
|
||||||
|
@ -51,7 +51,7 @@ rules.forEach(function forRule(rule) {
|
||||||
case "MD003":
|
case "MD003":
|
||||||
scheme.properties = {
|
scheme.properties = {
|
||||||
"style": {
|
"style": {
|
||||||
"description": "Header style",
|
"description": "Heading style",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"enum": [
|
"enum": [
|
||||||
"consistent",
|
"consistent",
|
||||||
|
@ -139,8 +139,13 @@ rules.forEach(function forRule(rule) {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"default": true
|
"default": true
|
||||||
},
|
},
|
||||||
|
"headings": {
|
||||||
|
"description": "Include headings",
|
||||||
|
"type": "boolean",
|
||||||
|
"default": true
|
||||||
|
},
|
||||||
"headers": {
|
"headers": {
|
||||||
"description": "Include headers",
|
"description": "Include headings",
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"default": true
|
"default": true
|
||||||
}
|
}
|
||||||
|
@ -218,7 +223,7 @@ rules.forEach(function forRule(rule) {
|
||||||
case "MD041":
|
case "MD041":
|
||||||
scheme.properties = {
|
scheme.properties = {
|
||||||
"level": {
|
"level": {
|
||||||
"description": "Header level",
|
"description": "Heading level",
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
"default": 1
|
"default": 1
|
||||||
},
|
},
|
||||||
|
@ -231,8 +236,16 @@ rules.forEach(function forRule(rule) {
|
||||||
break;
|
break;
|
||||||
case "MD043":
|
case "MD043":
|
||||||
scheme.properties = {
|
scheme.properties = {
|
||||||
|
"headings": {
|
||||||
|
"description": "List of headings",
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"default": null
|
||||||
|
},
|
||||||
"headers": {
|
"headers": {
|
||||||
"description": "List of headers",
|
"description": "List of headings",
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"items": {
|
"items": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
|
|
|
@ -13,17 +13,22 @@
|
||||||
"default": null
|
"default": null
|
||||||
},
|
},
|
||||||
"MD001": {
|
"MD001": {
|
||||||
"description": "MD001/header-increment - Header levels should only increment by one level at a time",
|
"description": "MD001/heading-increment/header-increment - Heading levels should only increment by one level at a time",
|
||||||
|
"type": "boolean",
|
||||||
|
"default": true
|
||||||
|
},
|
||||||
|
"heading-increment": {
|
||||||
|
"description": "MD001/heading-increment/header-increment - Heading levels should only increment by one level at a time",
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"default": true
|
"default": true
|
||||||
},
|
},
|
||||||
"header-increment": {
|
"header-increment": {
|
||||||
"description": "MD001/header-increment - Header levels should only increment by one level at a time",
|
"description": "MD001/heading-increment/header-increment - Heading levels should only increment by one level at a time",
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"default": true
|
"default": true
|
||||||
},
|
},
|
||||||
"MD002": {
|
"MD002": {
|
||||||
"description": "MD002/first-header-h1 - First header should be a top level header",
|
"description": "MD002/first-heading-h1/first-header-h1 - First heading should be a top level heading",
|
||||||
"type": [
|
"type": [
|
||||||
"boolean",
|
"boolean",
|
||||||
"object"
|
"object"
|
||||||
|
@ -31,7 +36,23 @@
|
||||||
"default": true,
|
"default": true,
|
||||||
"properties": {
|
"properties": {
|
||||||
"level": {
|
"level": {
|
||||||
"description": "Header level",
|
"description": "Heading level",
|
||||||
|
"type": "integer",
|
||||||
|
"default": 1
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"additionalProperties": false
|
||||||
|
},
|
||||||
|
"first-heading-h1": {
|
||||||
|
"description": "MD002/first-heading-h1/first-header-h1 - First heading should be a top level heading",
|
||||||
|
"type": [
|
||||||
|
"boolean",
|
||||||
|
"object"
|
||||||
|
],
|
||||||
|
"default": true,
|
||||||
|
"properties": {
|
||||||
|
"level": {
|
||||||
|
"description": "Heading level",
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
"default": 1
|
"default": 1
|
||||||
}
|
}
|
||||||
|
@ -39,7 +60,7 @@
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
},
|
},
|
||||||
"first-header-h1": {
|
"first-header-h1": {
|
||||||
"description": "MD002/first-header-h1 - First header should be a top level header",
|
"description": "MD002/first-heading-h1/first-header-h1 - First heading should be a top level heading",
|
||||||
"type": [
|
"type": [
|
||||||
"boolean",
|
"boolean",
|
||||||
"object"
|
"object"
|
||||||
|
@ -47,7 +68,7 @@
|
||||||
"default": true,
|
"default": true,
|
||||||
"properties": {
|
"properties": {
|
||||||
"level": {
|
"level": {
|
||||||
"description": "Header level",
|
"description": "Heading level",
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
"default": 1
|
"default": 1
|
||||||
}
|
}
|
||||||
|
@ -55,7 +76,7 @@
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
},
|
},
|
||||||
"MD003": {
|
"MD003": {
|
||||||
"description": "MD003/header-style - Header style",
|
"description": "MD003/heading-style/header-style - Heading style",
|
||||||
"type": [
|
"type": [
|
||||||
"boolean",
|
"boolean",
|
||||||
"object"
|
"object"
|
||||||
|
@ -63,7 +84,31 @@
|
||||||
"default": true,
|
"default": true,
|
||||||
"properties": {
|
"properties": {
|
||||||
"style": {
|
"style": {
|
||||||
"description": "Header style",
|
"description": "Heading style",
|
||||||
|
"type": "string",
|
||||||
|
"enum": [
|
||||||
|
"consistent",
|
||||||
|
"atx",
|
||||||
|
"atx_closed",
|
||||||
|
"setext",
|
||||||
|
"setext_with_atx",
|
||||||
|
"setext_with_atx_closed"
|
||||||
|
],
|
||||||
|
"default": "consistent"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"additionalProperties": false
|
||||||
|
},
|
||||||
|
"heading-style": {
|
||||||
|
"description": "MD003/heading-style/header-style - Heading style",
|
||||||
|
"type": [
|
||||||
|
"boolean",
|
||||||
|
"object"
|
||||||
|
],
|
||||||
|
"default": true,
|
||||||
|
"properties": {
|
||||||
|
"style": {
|
||||||
|
"description": "Heading style",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"enum": [
|
"enum": [
|
||||||
"consistent",
|
"consistent",
|
||||||
|
@ -79,7 +124,7 @@
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
},
|
},
|
||||||
"header-style": {
|
"header-style": {
|
||||||
"description": "MD003/header-style - Header style",
|
"description": "MD003/heading-style/header-style - Heading style",
|
||||||
"type": [
|
"type": [
|
||||||
"boolean",
|
"boolean",
|
||||||
"object"
|
"object"
|
||||||
|
@ -87,7 +132,7 @@
|
||||||
"default": true,
|
"default": true,
|
||||||
"properties": {
|
"properties": {
|
||||||
"style": {
|
"style": {
|
||||||
"description": "Header style",
|
"description": "Heading style",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"enum": [
|
"enum": [
|
||||||
"consistent",
|
"consistent",
|
||||||
|
@ -339,8 +384,13 @@
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"default": true
|
"default": true
|
||||||
},
|
},
|
||||||
|
"headings": {
|
||||||
|
"description": "Include headings",
|
||||||
|
"type": "boolean",
|
||||||
|
"default": true
|
||||||
|
},
|
||||||
"headers": {
|
"headers": {
|
||||||
"description": "Include headers",
|
"description": "Include headings",
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"default": true
|
"default": true
|
||||||
}
|
}
|
||||||
|
@ -370,8 +420,13 @@
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"default": true
|
"default": true
|
||||||
},
|
},
|
||||||
|
"headings": {
|
||||||
|
"description": "Include headings",
|
||||||
|
"type": "boolean",
|
||||||
|
"default": true
|
||||||
|
},
|
||||||
"headers": {
|
"headers": {
|
||||||
"description": "Include headers",
|
"description": "Include headings",
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"default": true
|
"default": true
|
||||||
}
|
}
|
||||||
|
@ -389,77 +444,92 @@
|
||||||
"default": true
|
"default": true
|
||||||
},
|
},
|
||||||
"MD018": {
|
"MD018": {
|
||||||
"description": "MD018/no-missing-space-atx - No space after hash on atx style header",
|
"description": "MD018/no-missing-space-atx - No space after hash on atx style heading",
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"default": true
|
"default": true
|
||||||
},
|
},
|
||||||
"no-missing-space-atx": {
|
"no-missing-space-atx": {
|
||||||
"description": "MD018/no-missing-space-atx - No space after hash on atx style header",
|
"description": "MD018/no-missing-space-atx - No space after hash on atx style heading",
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"default": true
|
"default": true
|
||||||
},
|
},
|
||||||
"MD019": {
|
"MD019": {
|
||||||
"description": "MD019/no-multiple-space-atx - Multiple spaces after hash on atx style header",
|
"description": "MD019/no-multiple-space-atx - Multiple spaces after hash on atx style heading",
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"default": true
|
"default": true
|
||||||
},
|
},
|
||||||
"no-multiple-space-atx": {
|
"no-multiple-space-atx": {
|
||||||
"description": "MD019/no-multiple-space-atx - Multiple spaces after hash on atx style header",
|
"description": "MD019/no-multiple-space-atx - Multiple spaces after hash on atx style heading",
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"default": true
|
"default": true
|
||||||
},
|
},
|
||||||
"MD020": {
|
"MD020": {
|
||||||
"description": "MD020/no-missing-space-closed-atx - No space inside hashes on closed atx style header",
|
"description": "MD020/no-missing-space-closed-atx - No space inside hashes on closed atx style heading",
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"default": true
|
"default": true
|
||||||
},
|
},
|
||||||
"no-missing-space-closed-atx": {
|
"no-missing-space-closed-atx": {
|
||||||
"description": "MD020/no-missing-space-closed-atx - No space inside hashes on closed atx style header",
|
"description": "MD020/no-missing-space-closed-atx - No space inside hashes on closed atx style heading",
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"default": true
|
"default": true
|
||||||
},
|
},
|
||||||
"MD021": {
|
"MD021": {
|
||||||
"description": "MD021/no-multiple-space-closed-atx - Multiple spaces inside hashes on closed atx style header",
|
"description": "MD021/no-multiple-space-closed-atx - Multiple spaces inside hashes on closed atx style heading",
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"default": true
|
"default": true
|
||||||
},
|
},
|
||||||
"no-multiple-space-closed-atx": {
|
"no-multiple-space-closed-atx": {
|
||||||
"description": "MD021/no-multiple-space-closed-atx - Multiple spaces inside hashes on closed atx style header",
|
"description": "MD021/no-multiple-space-closed-atx - Multiple spaces inside hashes on closed atx style heading",
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"default": true
|
"default": true
|
||||||
},
|
},
|
||||||
"MD022": {
|
"MD022": {
|
||||||
"description": "MD022/blanks-around-headers - Headers should be surrounded by blank lines",
|
"description": "MD022/blanks-around-headings/blanks-around-headers - Headings should be surrounded by blank lines",
|
||||||
|
"type": "boolean",
|
||||||
|
"default": true
|
||||||
|
},
|
||||||
|
"blanks-around-headings": {
|
||||||
|
"description": "MD022/blanks-around-headings/blanks-around-headers - Headings should be surrounded by blank lines",
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"default": true
|
"default": true
|
||||||
},
|
},
|
||||||
"blanks-around-headers": {
|
"blanks-around-headers": {
|
||||||
"description": "MD022/blanks-around-headers - Headers should be surrounded by blank lines",
|
"description": "MD022/blanks-around-headings/blanks-around-headers - Headings should be surrounded by blank lines",
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"default": true
|
"default": true
|
||||||
},
|
},
|
||||||
"MD023": {
|
"MD023": {
|
||||||
"description": "MD023/header-start-left - Headers must start at the beginning of the line",
|
"description": "MD023/heading-start-left/header-start-left - Headings must start at the beginning of the line",
|
||||||
|
"type": "boolean",
|
||||||
|
"default": true
|
||||||
|
},
|
||||||
|
"heading-start-left": {
|
||||||
|
"description": "MD023/heading-start-left/header-start-left - Headings must start at the beginning of the line",
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"default": true
|
"default": true
|
||||||
},
|
},
|
||||||
"header-start-left": {
|
"header-start-left": {
|
||||||
"description": "MD023/header-start-left - Headers must start at the beginning of the line",
|
"description": "MD023/heading-start-left/header-start-left - Headings must start at the beginning of the line",
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"default": true
|
"default": true
|
||||||
},
|
},
|
||||||
"MD024": {
|
"MD024": {
|
||||||
"description": "MD024/no-duplicate-header - Multiple headers with the same content",
|
"description": "MD024/no-duplicate-heading/no-duplicate-header - Multiple headings with the same content",
|
||||||
|
"type": "boolean",
|
||||||
|
"default": true
|
||||||
|
},
|
||||||
|
"no-duplicate-heading": {
|
||||||
|
"description": "MD024/no-duplicate-heading/no-duplicate-header - Multiple headings with the same content",
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"default": true
|
"default": true
|
||||||
},
|
},
|
||||||
"no-duplicate-header": {
|
"no-duplicate-header": {
|
||||||
"description": "MD024/no-duplicate-header - Multiple headers with the same content",
|
"description": "MD024/no-duplicate-heading/no-duplicate-header - Multiple headings with the same content",
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"default": true
|
"default": true
|
||||||
},
|
},
|
||||||
"MD025": {
|
"MD025": {
|
||||||
"description": "MD025/single-h1 - Multiple top level headers in the same document",
|
"description": "MD025/single-h1 - Multiple top level headings in the same document",
|
||||||
"type": [
|
"type": [
|
||||||
"boolean",
|
"boolean",
|
||||||
"object"
|
"object"
|
||||||
|
@ -467,7 +537,7 @@
|
||||||
"default": true,
|
"default": true,
|
||||||
"properties": {
|
"properties": {
|
||||||
"level": {
|
"level": {
|
||||||
"description": "Header level",
|
"description": "Heading level",
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
"default": 1
|
"default": 1
|
||||||
}
|
}
|
||||||
|
@ -475,7 +545,7 @@
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
},
|
},
|
||||||
"single-h1": {
|
"single-h1": {
|
||||||
"description": "MD025/single-h1 - Multiple top level headers in the same document",
|
"description": "MD025/single-h1 - Multiple top level headings in the same document",
|
||||||
"type": [
|
"type": [
|
||||||
"boolean",
|
"boolean",
|
||||||
"object"
|
"object"
|
||||||
|
@ -483,7 +553,7 @@
|
||||||
"default": true,
|
"default": true,
|
||||||
"properties": {
|
"properties": {
|
||||||
"level": {
|
"level": {
|
||||||
"description": "Header level",
|
"description": "Heading level",
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
"default": 1
|
"default": 1
|
||||||
}
|
}
|
||||||
|
@ -491,7 +561,7 @@
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
},
|
},
|
||||||
"MD026": {
|
"MD026": {
|
||||||
"description": "MD026/no-trailing-punctuation - Trailing punctuation in header",
|
"description": "MD026/no-trailing-punctuation - Trailing punctuation in heading",
|
||||||
"type": [
|
"type": [
|
||||||
"boolean",
|
"boolean",
|
||||||
"object"
|
"object"
|
||||||
|
@ -507,7 +577,7 @@
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
},
|
},
|
||||||
"no-trailing-punctuation": {
|
"no-trailing-punctuation": {
|
||||||
"description": "MD026/no-trailing-punctuation - Trailing punctuation in header",
|
"description": "MD026/no-trailing-punctuation - Trailing punctuation in heading",
|
||||||
"type": [
|
"type": [
|
||||||
"boolean",
|
"boolean",
|
||||||
"object"
|
"object"
|
||||||
|
@ -747,7 +817,23 @@
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
},
|
},
|
||||||
"MD036": {
|
"MD036": {
|
||||||
"description": "MD036/no-emphasis-as-header - Emphasis used instead of a header",
|
"description": "MD036/no-emphasis-as-heading/no-emphasis-as-header - Emphasis used instead of a heading",
|
||||||
|
"type": [
|
||||||
|
"boolean",
|
||||||
|
"object"
|
||||||
|
],
|
||||||
|
"default": true,
|
||||||
|
"properties": {
|
||||||
|
"punctuation": {
|
||||||
|
"description": "Punctuation characters",
|
||||||
|
"type": "string",
|
||||||
|
"default": ".,;:!?"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"additionalProperties": false
|
||||||
|
},
|
||||||
|
"no-emphasis-as-heading": {
|
||||||
|
"description": "MD036/no-emphasis-as-heading/no-emphasis-as-header - Emphasis used instead of a heading",
|
||||||
"type": [
|
"type": [
|
||||||
"boolean",
|
"boolean",
|
||||||
"object"
|
"object"
|
||||||
|
@ -763,7 +849,7 @@
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
},
|
},
|
||||||
"no-emphasis-as-header": {
|
"no-emphasis-as-header": {
|
||||||
"description": "MD036/no-emphasis-as-header - Emphasis used instead of a header",
|
"description": "MD036/no-emphasis-as-heading/no-emphasis-as-header - Emphasis used instead of a heading",
|
||||||
"type": [
|
"type": [
|
||||||
"boolean",
|
"boolean",
|
||||||
"object"
|
"object"
|
||||||
|
@ -819,7 +905,7 @@
|
||||||
"default": true
|
"default": true
|
||||||
},
|
},
|
||||||
"MD041": {
|
"MD041": {
|
||||||
"description": "MD041/first-line-h1 - First line in file should be a top level header",
|
"description": "MD041/first-line-h1 - First line in file should be a top level heading",
|
||||||
"type": [
|
"type": [
|
||||||
"boolean",
|
"boolean",
|
||||||
"object"
|
"object"
|
||||||
|
@ -827,7 +913,7 @@
|
||||||
"default": true,
|
"default": true,
|
||||||
"properties": {
|
"properties": {
|
||||||
"level": {
|
"level": {
|
||||||
"description": "Header level",
|
"description": "Heading level",
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
"default": 1
|
"default": 1
|
||||||
},
|
},
|
||||||
|
@ -840,7 +926,7 @@
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
},
|
},
|
||||||
"first-line-h1": {
|
"first-line-h1": {
|
||||||
"description": "MD041/first-line-h1 - First line in file should be a top level header",
|
"description": "MD041/first-line-h1 - First line in file should be a top level heading",
|
||||||
"type": [
|
"type": [
|
||||||
"boolean",
|
"boolean",
|
||||||
"object"
|
"object"
|
||||||
|
@ -848,7 +934,7 @@
|
||||||
"default": true,
|
"default": true,
|
||||||
"properties": {
|
"properties": {
|
||||||
"level": {
|
"level": {
|
||||||
"description": "Header level",
|
"description": "Heading level",
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
"default": 1
|
"default": 1
|
||||||
},
|
},
|
||||||
|
@ -871,15 +957,50 @@
|
||||||
"default": true
|
"default": true
|
||||||
},
|
},
|
||||||
"MD043": {
|
"MD043": {
|
||||||
"description": "MD043/required-headers - Required header structure",
|
"description": "MD043/required-headings/required-headers - Required heading structure",
|
||||||
"type": [
|
"type": [
|
||||||
"boolean",
|
"boolean",
|
||||||
"object"
|
"object"
|
||||||
],
|
],
|
||||||
"default": true,
|
"default": true,
|
||||||
"properties": {
|
"properties": {
|
||||||
|
"headings": {
|
||||||
|
"description": "List of headings",
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"default": null
|
||||||
|
},
|
||||||
"headers": {
|
"headers": {
|
||||||
"description": "List of headers",
|
"description": "List of headings",
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"default": null
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"additionalProperties": false
|
||||||
|
},
|
||||||
|
"required-headings": {
|
||||||
|
"description": "MD043/required-headings/required-headers - Required heading structure",
|
||||||
|
"type": [
|
||||||
|
"boolean",
|
||||||
|
"object"
|
||||||
|
],
|
||||||
|
"default": true,
|
||||||
|
"properties": {
|
||||||
|
"headings": {
|
||||||
|
"description": "List of headings",
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"default": null
|
||||||
|
},
|
||||||
|
"headers": {
|
||||||
|
"description": "List of headings",
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"items": {
|
"items": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
|
@ -890,15 +1011,23 @@
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
},
|
},
|
||||||
"required-headers": {
|
"required-headers": {
|
||||||
"description": "MD043/required-headers - Required header structure",
|
"description": "MD043/required-headings/required-headers - Required heading structure",
|
||||||
"type": [
|
"type": [
|
||||||
"boolean",
|
"boolean",
|
||||||
"object"
|
"object"
|
||||||
],
|
],
|
||||||
"default": true,
|
"default": true,
|
||||||
"properties": {
|
"properties": {
|
||||||
|
"headings": {
|
||||||
|
"description": "List of headings",
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"default": null
|
||||||
|
},
|
||||||
"headers": {
|
"headers": {
|
||||||
"description": "List of headers",
|
"description": "List of headings",
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"items": {
|
"items": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
|
@ -966,6 +1095,11 @@
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"default": true
|
"default": true
|
||||||
},
|
},
|
||||||
|
"headings": {
|
||||||
|
"description": "headings - MD001, MD002, MD003, MD018, MD019, MD020, MD021, MD022, MD023, MD024, MD025, MD026, MD036, MD041, MD043",
|
||||||
|
"type": "boolean",
|
||||||
|
"default": true
|
||||||
|
},
|
||||||
"headers": {
|
"headers": {
|
||||||
"description": "headers - MD001, MD002, MD003, MD018, MD019, MD020, MD021, MD022, MD023, MD024, MD025, MD026, MD036, MD041, MD043",
|
"description": "headers - MD001, MD002, MD003, MD018, MD019, MD020, MD021, MD022, MD023, MD024, MD025, MD026, MD036, MD041, MD043",
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
## A level 2 top level header
|
|
||||||
|
|
||||||
## Another one {MD025}
|
|
3
test/alternate_top_level_heading.md
Normal file
3
test/alternate_top_level_heading.md
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
## A level 2 top level heading
|
||||||
|
|
||||||
|
## Another one {MD025}
|
|
@ -1,17 +0,0 @@
|
||||||
#Header 1 {MD020} #
|
|
||||||
|
|
||||||
## Header 2 {MD020}##
|
|
||||||
|
|
||||||
##Header 3 {MD020}##
|
|
||||||
|
|
||||||
## Header 4 {MD021} ##
|
|
||||||
|
|
||||||
## Header 5 {MD021} ##
|
|
||||||
|
|
||||||
## Header 6 {MD021} ##
|
|
||||||
|
|
||||||
## Header 7 {MD021} ##
|
|
||||||
|
|
||||||
## Header 8 \#
|
|
||||||
|
|
||||||
## Header 9 \#
|
|
17
test/atx_closed_heading_spacing.md
Normal file
17
test/atx_closed_heading_spacing.md
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
#Heading 1 {MD020} #
|
||||||
|
|
||||||
|
## Heading 2 {MD020}##
|
||||||
|
|
||||||
|
##Heading 3 {MD020}##
|
||||||
|
|
||||||
|
## Heading 4 {MD021} ##
|
||||||
|
|
||||||
|
## Heading 5 {MD021} ##
|
||||||
|
|
||||||
|
## Heading 6 {MD021} ##
|
||||||
|
|
||||||
|
## Heading 7 {MD021} ##
|
||||||
|
|
||||||
|
## Heading 8 \#
|
||||||
|
|
||||||
|
## Heading 9 \#
|
|
@ -1,5 +0,0 @@
|
||||||
#Header 1 {MD018}
|
|
||||||
|
|
||||||
## Header 2 {MD019}
|
|
||||||
|
|
||||||
## Header 3 {MD019}
|
|
5
test/atx_heading_spacing.md
Normal file
5
test/atx_heading_spacing.md
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
#Heading 1 {MD018}
|
||||||
|
|
||||||
|
## Heading 2 {MD019}
|
||||||
|
|
||||||
|
## Heading 3 {MD019}
|
|
@ -2,9 +2,9 @@
|
||||||
"default": true,
|
"default": true,
|
||||||
"MD041": true,
|
"MD041": true,
|
||||||
"MD043": {
|
"MD043": {
|
||||||
"headers": [
|
"headings": [
|
||||||
"## Header 1 {MD002} {MD041}",
|
"## Heading 1 {MD002} {MD041}",
|
||||||
"#### Header 2 {MD001}",
|
"#### Heading 2 {MD001}",
|
||||||
"# Broken"
|
"# Broken"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
## Header 1 {MD002} {MD041}
|
## Heading 1 {MD002} {MD041}
|
||||||
|
|
||||||
#### Header 2 {MD001}
|
#### Heading 2 {MD001}
|
||||||
|
|
||||||
# Header 3 {MD003} {MD043} #
|
# Heading 3 {MD003} {MD043} #
|
||||||
|
|
||||||
* list
|
* list
|
||||||
+ list {MD004} {MD006} {MD007} {MD030}
|
+ list {MD004} {MD006} {MD007} {MD030}
|
||||||
|
@ -22,22 +22,22 @@ long line long line long line long line long line long line long line long line
|
||||||
|
|
||||||
$ dollar {MD014}
|
$ dollar {MD014}
|
||||||
|
|
||||||
#Header 4 {MD018}
|
#Heading 4 {MD018}
|
||||||
|
|
||||||
# Header 5 {MD019}
|
# Heading 5 {MD019}
|
||||||
|
|
||||||
#Header 6 {MD020} #
|
#Heading 6 {MD020} #
|
||||||
# Header 7 {MD021} {MD022} {MD023} {MD003} #
|
# Heading 7 {MD021} {MD022} {MD023} {MD003} #
|
||||||
|
|
||||||
# Header 8
|
# Heading 8
|
||||||
|
|
||||||
# Header 8
|
# Heading 8
|
||||||
|
|
||||||
{MD024:34}
|
{MD024:34}
|
||||||
|
|
||||||
Note: Can not break MD025 and MD002 in the same file
|
Note: Can not break MD025 and MD002 in the same file
|
||||||
|
|
||||||
# Header 9 {MD026}.
|
# Heading 9 {MD026}.
|
||||||
|
|
||||||
> {MD027}
|
> {MD027}
|
||||||
|
|
||||||
|
@ -62,7 +62,7 @@ http://example.com/page {MD034}
|
||||||
|
|
||||||
{MD035:61}
|
{MD035:61}
|
||||||
|
|
||||||
_Section {MD036} Header_
|
_Section {MD036} Heading_
|
||||||
|
|
||||||
Emphasis *with * space {MD037}
|
Emphasis *with * space {MD037}
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
# Header
|
# Heading
|
||||||
|
|
||||||
Text
|
Text
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Header
|
# Heading
|
||||||
|
|
||||||
```js
|
```js
|
||||||
|
|
||||||
|
@ -10,5 +10,5 @@
|
||||||
```
|
```
|
||||||
|
|
||||||
```spaces
|
```spaces
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# header
|
# heading
|
||||||
|
|
||||||
```fence
|
```fence
|
||||||
$ code
|
$ code
|
||||||
|
|
|
@ -1,24 +1,24 @@
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"lineNumber": 3,
|
"lineNumber": 3,
|
||||||
"ruleNames": [ "MD001", "header-increment" ],
|
"ruleNames": [ "MD001", "heading-increment", "header-increment" ],
|
||||||
"ruleDescription": "Header levels should only increment by one level at a time",
|
"ruleDescription": "Heading levels should only increment by one level at a time",
|
||||||
"errorDetail": "Expected: h3; Actual: h4",
|
"errorDetail": "Expected: h3; Actual: h4",
|
||||||
"errorContext": null,
|
"errorContext": null,
|
||||||
"errorRange": null
|
"errorRange": null
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"lineNumber": 1,
|
"lineNumber": 1,
|
||||||
"ruleNames": [ "MD002", "first-header-h1" ],
|
"ruleNames": [ "MD002", "first-heading-h1", "first-header-h1" ],
|
||||||
"ruleDescription": "First header should be a top level header",
|
"ruleDescription": "First heading should be a top level heading",
|
||||||
"errorDetail": "Expected: h1; Actual: h2",
|
"errorDetail": "Expected: h1; Actual: h2",
|
||||||
"errorContext": null,
|
"errorContext": null,
|
||||||
"errorRange": null
|
"errorRange": null
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"lineNumber": 5,
|
"lineNumber": 5,
|
||||||
"ruleNames": [ "MD003", "header-style" ],
|
"ruleNames": [ "MD003", "heading-style", "header-style" ],
|
||||||
"ruleDescription": "Header style",
|
"ruleDescription": "Heading style",
|
||||||
"errorDetail": "Expected: atx; Actual: atx_closed",
|
"errorDetail": "Expected: atx; Actual: atx_closed",
|
||||||
"errorContext": null,
|
"errorContext": null,
|
||||||
"errorRange": null
|
"errorRange": null
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Top level header
|
# Top level heading
|
||||||
|
|
||||||
<!-- markdownlint-disable MD003 -->
|
<!-- markdownlint-disable MD003 -->
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
{
|
{
|
||||||
"lineNumber": 12,
|
"lineNumber": 12,
|
||||||
"ruleNames": [ "MD018", "no-missing-space-atx" ],
|
"ruleNames": [ "MD018", "no-missing-space-atx" ],
|
||||||
"ruleDescription": "No space after hash on atx style header",
|
"ruleDescription": "No space after hash on atx style heading",
|
||||||
"errorDetail": null,
|
"errorDetail": null,
|
||||||
"errorContext": "##No space A",
|
"errorContext": "##No space A",
|
||||||
"errorRange": [1, 3]
|
"errorRange": [1, 3]
|
||||||
|
@ -42,7 +42,7 @@
|
||||||
{
|
{
|
||||||
"lineNumber": 14,
|
"lineNumber": 14,
|
||||||
"ruleNames": [ "MD019", "no-multiple-space-atx" ],
|
"ruleNames": [ "MD019", "no-multiple-space-atx" ],
|
||||||
"ruleDescription": "Multiple spaces after hash on atx style header",
|
"ruleDescription": "Multiple spaces after hash on atx style heading",
|
||||||
"errorDetail": null,
|
"errorDetail": null,
|
||||||
"errorContext": "## Multiple spaces B",
|
"errorContext": "## Multiple spaces B",
|
||||||
"errorRange": [1, 5]
|
"errorRange": [1, 5]
|
||||||
|
@ -50,7 +50,7 @@
|
||||||
{
|
{
|
||||||
"lineNumber": 16,
|
"lineNumber": 16,
|
||||||
"ruleNames": [ "MD020", "no-missing-space-closed-atx" ],
|
"ruleNames": [ "MD020", "no-missing-space-closed-atx" ],
|
||||||
"ruleDescription": "No space inside hashes on closed atx style header",
|
"ruleDescription": "No space inside hashes on closed atx style heading",
|
||||||
"errorDetail": null,
|
"errorDetail": null,
|
||||||
"errorContext": "##No space C ##",
|
"errorContext": "##No space C ##",
|
||||||
"errorRange": [1, 3]
|
"errorRange": [1, 3]
|
||||||
|
@ -58,7 +58,7 @@
|
||||||
{
|
{
|
||||||
"lineNumber": 18,
|
"lineNumber": 18,
|
||||||
"ruleNames": [ "MD020", "no-missing-space-closed-atx" ],
|
"ruleNames": [ "MD020", "no-missing-space-closed-atx" ],
|
||||||
"ruleDescription": "No space inside hashes on closed atx style header",
|
"ruleDescription": "No space inside hashes on closed atx style heading",
|
||||||
"errorDetail": null,
|
"errorDetail": null,
|
||||||
"errorContext": "## No space D##",
|
"errorContext": "## No space D##",
|
||||||
"errorRange": [13, 3]
|
"errorRange": [13, 3]
|
||||||
|
@ -66,7 +66,7 @@
|
||||||
{
|
{
|
||||||
"lineNumber": 20,
|
"lineNumber": 20,
|
||||||
"ruleNames": [ "MD021", "no-multiple-space-closed-atx" ],
|
"ruleNames": [ "MD021", "no-multiple-space-closed-atx" ],
|
||||||
"ruleDescription": "Multiple spaces inside hashes on closed atx style header",
|
"ruleDescription": "Multiple spaces inside hashes on closed atx style heading",
|
||||||
"errorDetail": null,
|
"errorDetail": null,
|
||||||
"errorContext": "## Multiple spaces E ##",
|
"errorContext": "## Multiple spaces E ##",
|
||||||
"errorRange": [1, 5]
|
"errorRange": [1, 5]
|
||||||
|
@ -74,7 +74,7 @@
|
||||||
{
|
{
|
||||||
"lineNumber": 22,
|
"lineNumber": 22,
|
||||||
"ruleNames": [ "MD021", "no-multiple-space-closed-atx" ],
|
"ruleNames": [ "MD021", "no-multiple-space-closed-atx" ],
|
||||||
"ruleDescription": "Multiple spaces inside hashes on closed atx style header",
|
"ruleDescription": "Multiple spaces inside hashes on closed atx style heading",
|
||||||
"errorDetail": null,
|
"errorDetail": null,
|
||||||
"errorContext": "## Multiple spaces F ##",
|
"errorContext": "## Multiple spaces F ##",
|
||||||
"errorRange": [20, 5]
|
"errorRange": [20, 5]
|
||||||
|
|
|
@ -1,24 +1,24 @@
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"lineNumber": 1,
|
"lineNumber": 1,
|
||||||
"ruleNames": [ "MD022", "blanks-around-headers" ],
|
"ruleNames": [ "MD022", "blanks-around-headings", "blanks-around-headers" ],
|
||||||
"ruleDescription": "Headers should be surrounded by blank lines",
|
"ruleDescription": "Headings should be surrounded by blank lines",
|
||||||
"errorDetail": null,
|
"errorDetail": null,
|
||||||
"errorContext": "# Heading",
|
"errorContext": "# Heading",
|
||||||
"errorRange": null
|
"errorRange": null
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"lineNumber": 1,
|
"lineNumber": 1,
|
||||||
"ruleNames": [ "MD023", "header-start-left" ],
|
"ruleNames": [ "MD023", "heading-start-left", "header-start-left" ],
|
||||||
"ruleDescription": "Headers must start at the beginning of the line",
|
"ruleDescription": "Headings must start at the beginning of the line",
|
||||||
"errorDetail": null,
|
"errorDetail": null,
|
||||||
"errorContext": " # Heading",
|
"errorContext": " # Heading",
|
||||||
"errorRange": [1, 2]
|
"errorRange": [1, 2]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"lineNumber": 4,
|
"lineNumber": 4,
|
||||||
"ruleNames": [ "MD024", "no-duplicate-header" ],
|
"ruleNames": [ "MD024", "no-duplicate-heading", "no-duplicate-header" ],
|
||||||
"ruleDescription": "Multiple headers with the same content",
|
"ruleDescription": "Multiple headings with the same content",
|
||||||
"errorDetail": null,
|
"errorDetail": null,
|
||||||
"errorContext": "# Heading",
|
"errorContext": "# Heading",
|
||||||
"errorRange": null
|
"errorRange": null
|
||||||
|
@ -26,7 +26,7 @@
|
||||||
{
|
{
|
||||||
"lineNumber": 4,
|
"lineNumber": 4,
|
||||||
"ruleNames": [ "MD025", "single-h1" ],
|
"ruleNames": [ "MD025", "single-h1" ],
|
||||||
"ruleDescription": "Multiple top level headers in the same document",
|
"ruleDescription": "Multiple top level headings in the same document",
|
||||||
"errorDetail": null,
|
"errorDetail": null,
|
||||||
"errorContext": "# Heading",
|
"errorContext": "# Heading",
|
||||||
"errorRange": null
|
"errorRange": null
|
||||||
|
@ -34,7 +34,7 @@
|
||||||
{
|
{
|
||||||
"lineNumber": 6,
|
"lineNumber": 6,
|
||||||
"ruleNames": [ "MD026", "no-trailing-punctuation" ],
|
"ruleNames": [ "MD026", "no-trailing-punctuation" ],
|
||||||
"ruleDescription": "Trailing punctuation in header",
|
"ruleDescription": "Trailing punctuation in heading",
|
||||||
"errorDetail": "Punctuation: '.'",
|
"errorDetail": "Punctuation: '.'",
|
||||||
"errorContext": null,
|
"errorContext": null,
|
||||||
"errorRange": [19, 1]
|
"errorRange": [19, 1]
|
||||||
|
|
|
@ -41,8 +41,8 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"lineNumber": 13,
|
"lineNumber": 13,
|
||||||
"ruleNames": [ "MD036", "no-emphasis-as-header" ],
|
"ruleNames": [ "MD036", "no-emphasis-as-heading", "no-emphasis-as-header" ],
|
||||||
"ruleDescription": "Emphasis used instead of a header",
|
"ruleDescription": "Emphasis used instead of a heading",
|
||||||
"errorDetail": null,
|
"errorDetail": null,
|
||||||
"errorContext": "Emphasis",
|
"errorContext": "Emphasis",
|
||||||
"errorRange": null
|
"errorRange": null
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
"default": true,
|
"default": true,
|
||||||
"MD041": true,
|
"MD041": true,
|
||||||
"MD043": {
|
"MD043": {
|
||||||
"headers": [
|
"headings": [
|
||||||
"# Header"
|
"# Heading"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"MD044": {
|
"MD044": {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
Not a header
|
Not a heading
|
||||||
|
|
||||||
An [empty]() link
|
An [empty]() link
|
||||||
|
|
||||||
|
|
|
@ -2,9 +2,9 @@
|
||||||
{
|
{
|
||||||
"lineNumber": 1,
|
"lineNumber": 1,
|
||||||
"ruleNames": [ "MD041", "first-line-h1" ],
|
"ruleNames": [ "MD041", "first-line-h1" ],
|
||||||
"ruleDescription": "First line in file should be a top level header",
|
"ruleDescription": "First line in file should be a top level heading",
|
||||||
"errorDetail": null,
|
"errorDetail": null,
|
||||||
"errorContext": "Not a header",
|
"errorContext": "Not a heading",
|
||||||
"errorRange": null
|
"errorRange": null
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -41,10 +41,10 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"lineNumber": 20,
|
"lineNumber": 20,
|
||||||
"ruleNames": [ "MD043", "required-headers" ],
|
"ruleNames": [ "MD043", "required-headings", "required-headers" ],
|
||||||
"ruleDescription": "Required header structure",
|
"ruleDescription": "Required heading structure",
|
||||||
"errorDetail": null,
|
"errorDetail": null,
|
||||||
"errorContext": "# Header",
|
"errorContext": "# Heading",
|
||||||
"errorRange": null
|
"errorRange": null
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
{
|
{
|
||||||
"lineNumber": 4,
|
"lineNumber": 4,
|
||||||
"ruleNames": [ "MD041", "first-line-h1" ],
|
"ruleNames": [ "MD041", "first-line-h1" ],
|
||||||
"ruleDescription": "First line in file should be a top level header",
|
"ruleDescription": "First line in file should be a top level heading",
|
||||||
"errorDetail": null,
|
"errorDetail": null,
|
||||||
"errorContext": "Text",
|
"errorContext": "Text",
|
||||||
"errorRange": null
|
"errorRange": null
|
||||||
|
|
|
@ -35,6 +35,6 @@ This is another **normal** paragraph with some text in it. This also should
|
||||||
not trigger the rule.
|
not trigger the rule.
|
||||||
|
|
||||||
**This is an entire paragraph that has been emphasized, and shouldn't be
|
**This is an entire paragraph that has been emphasized, and shouldn't be
|
||||||
detected as a header because it's on multiple lines**
|
detected as a heading because it's on multiple lines**
|
||||||
|
|
||||||
**This also shouldn't be detected as a header as it ends in punctuation.**
|
**This also shouldn't be detected as a heading as it ends in punctuation.**
|
|
@ -1,4 +1,4 @@
|
||||||
# header
|
# heading
|
||||||
|
|
||||||
text
|
text
|
||||||
```fence {MD031}
|
```fence {MD031}
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
## Header {MD002}
|
|
|
@ -1,2 +0,0 @@
|
||||||
Header {MD002}
|
|
||||||
--------------
|
|
|
@ -1 +0,0 @@
|
||||||
# Header
|
|
|
@ -1,2 +0,0 @@
|
||||||
Header
|
|
||||||
======
|
|
1
test/first_heading_bad_atx.md
Normal file
1
test/first_heading_bad_atx.md
Normal file
|
@ -0,0 +1 @@
|
||||||
|
## Heading {MD002}
|
2
test/first_heading_bad_setext.md
Normal file
2
test/first_heading_bad_setext.md
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
Heading {MD002}
|
||||||
|
--------------
|
1
test/first_heading_good_atx.md
Normal file
1
test/first_heading_good_atx.md
Normal file
|
@ -0,0 +1 @@
|
||||||
|
# Heading
|
2
test/first_heading_good_setext.md
Normal file
2
test/first_heading_good_setext.md
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
Heading
|
||||||
|
=======
|
|
@ -1,3 +0,0 @@
|
||||||
# First line is a top level header
|
|
||||||
|
|
||||||
This shouldn't trigger MD041
|
|
|
@ -1,4 +0,0 @@
|
||||||
First line top level header
|
|
||||||
===========================
|
|
||||||
|
|
||||||
This shouldn't trigger MD041
|
|
3
test/first_line_top_level_heading_atx.md
Normal file
3
test/first_line_top_level_heading_atx.md
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
# First line is a top level heading
|
||||||
|
|
||||||
|
This shouldn't trigger MD041
|
4
test/first_line_top_level_heading_setext.md
Normal file
4
test/first_line_top_level_heading_setext.md
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
First line top level heading
|
||||||
|
============================
|
||||||
|
|
||||||
|
This shouldn't trigger MD041
|
|
@ -1,6 +1,6 @@
|
||||||
+++
|
+++
|
||||||
date = "2017-01-26T22:17:00+02:00"
|
date = "2017-01-26T22:17:00+02:00"
|
||||||
alternate = "My document title and header"
|
alternate = "My document title and heading"
|
||||||
+++
|
+++
|
||||||
|
|
||||||
Some plain text here.
|
Some plain text here.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
---
|
---
|
||||||
# Header
|
# Heading
|
||||||
|
|
||||||
# Another {MD025}
|
# Another {MD025}
|
||||||
|
|
|
@ -4,6 +4,6 @@ notitle: "Welcome to Jekyll!"
|
||||||
date: 2015-11-17 16:16:01 -0600
|
date: 2015-11-17 16:16:01 -0600
|
||||||
categories: jekyll update
|
categories: jekyll update
|
||||||
---
|
---
|
||||||
# Top level header
|
# Top level heading
|
||||||
|
|
||||||
Front matter from [Jekyll documentation](https://jekyllrb.com/docs/posts/#a-typical-post).
|
Front matter from [Jekyll documentation](https://jekyllrb.com/docs/posts/#a-typical-post).
|
||||||
|
|
|
@ -4,6 +4,6 @@ title: "Welcome to Jekyll!"
|
||||||
date: 2015-11-17 16:16:01 -0600
|
date: 2015-11-17 16:16:01 -0600
|
||||||
categories: jekyll update
|
categories: jekyll update
|
||||||
---
|
---
|
||||||
# Top level header
|
# Top level heading
|
||||||
|
|
||||||
Front matter from [Jekyll documentation](https://jekyllrb.com/docs/posts/#a-typical-post).
|
Front matter from [Jekyll documentation](https://jekyllrb.com/docs/posts/#a-typical-post).
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
+++
|
+++
|
||||||
date = "2017-01-26T22:17:00+02:00"
|
date = "2017-01-26T22:17:00+02:00"
|
||||||
title = "My document title and header"
|
title = "My document title and heading"
|
||||||
+++
|
+++
|
||||||
|
|
||||||
Some plain text here.
|
Some plain text here.
|
||||||
|
|
|
@ -3,7 +3,7 @@ layout: post
|
||||||
title: Title with ---
|
title: Title with ---
|
||||||
tags: front matter
|
tags: front matter
|
||||||
---
|
---
|
||||||
## Header {MD002}
|
## Heading {MD002}
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
front: matter
|
front: matter
|
||||||
---
|
---
|
||||||
# Header 1
|
# Heading 1
|
||||||
|
|
||||||
## Header 2
|
## Heading 2
|
||||||
|
|
|
@ -1,11 +0,0 @@
|
||||||
# Header 1
|
|
||||||
|
|
||||||
## Header 2
|
|
||||||
|
|
||||||
## Header 1
|
|
||||||
|
|
||||||
### Header 2
|
|
||||||
|
|
||||||
## Header 3
|
|
||||||
|
|
||||||
{MD024:5} {MD024:7}
|
|
|
@ -1,7 +0,0 @@
|
||||||
# Header
|
|
||||||
|
|
||||||
### Header 3 {MD001}
|
|
||||||
|
|
||||||
## Header 2
|
|
||||||
|
|
||||||
#### Header 4 {MD001}
|
|
|
@ -1,11 +0,0 @@
|
||||||
Header 1
|
|
||||||
========
|
|
||||||
|
|
||||||
Header 2
|
|
||||||
--------
|
|
||||||
|
|
||||||
## Header 2 {MD003}
|
|
||||||
|
|
||||||
### Header 3
|
|
||||||
|
|
||||||
#### Header 4 {MD003} ####
|
|
|
@ -1,11 +0,0 @@
|
||||||
Header 1
|
|
||||||
========
|
|
||||||
|
|
||||||
Header 2
|
|
||||||
--------
|
|
||||||
|
|
||||||
## Header 2 {MD003} ##
|
|
||||||
|
|
||||||
### Header 3 ###
|
|
||||||
|
|
||||||
#### Header 4 {MD003}
|
|
|
@ -1,12 +0,0 @@
|
||||||
# Header 1
|
|
||||||
|
|
||||||
## Header 2 {MD022}
|
|
||||||
Some text
|
|
||||||
## Header 3 {MD022}
|
|
||||||
Some text
|
|
||||||
## Header 4 {MD022}
|
|
||||||
|
|
||||||
## Header 5
|
|
||||||
|
|
||||||
* This shouldn't trigger MD022, but did because of some bug where we tried to
|
|
||||||
#catch headers that kramdown didn't parse correctly.
|
|
|
@ -1,15 +0,0 @@
|
||||||
Header 1
|
|
||||||
========
|
|
||||||
|
|
||||||
Header 2 {MD022}
|
|
||||||
----------------
|
|
||||||
Some text {MD022} {MD025}
|
|
||||||
Header 3
|
|
||||||
================
|
|
||||||
Some text {MD022} {MD025}
|
|
||||||
Header 4
|
|
||||||
================
|
|
||||||
Some text
|
|
||||||
|
|
||||||
Header 5
|
|
||||||
--------
|
|
11
test/heading_duplicate_content.md
Normal file
11
test/heading_duplicate_content.md
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
# Heading 1
|
||||||
|
|
||||||
|
## Heading 2
|
||||||
|
|
||||||
|
## Heading 1
|
||||||
|
|
||||||
|
### Heading 2
|
||||||
|
|
||||||
|
## Heading 3
|
||||||
|
|
||||||
|
{MD024:5} {MD024:7}
|
7
test/headings_bad.md
Normal file
7
test/headings_bad.md
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
# Heading
|
||||||
|
|
||||||
|
### Heading 3 {MD001}
|
||||||
|
|
||||||
|
## Heading 2
|
||||||
|
|
||||||
|
#### Heading 4 {MD001}
|
11
test/headings_good_setext_with_atx.md
Normal file
11
test/headings_good_setext_with_atx.md
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
Heading 1
|
||||||
|
=========
|
||||||
|
|
||||||
|
Heading 2
|
||||||
|
---------
|
||||||
|
|
||||||
|
## Heading 2 {MD003}
|
||||||
|
|
||||||
|
### Heading 3
|
||||||
|
|
||||||
|
#### Heading 4 {MD003} ####
|
11
test/headings_good_setext_with_atx_closed.md
Normal file
11
test/headings_good_setext_with_atx_closed.md
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
Heading 1
|
||||||
|
=========
|
||||||
|
|
||||||
|
Heading 2
|
||||||
|
---------
|
||||||
|
|
||||||
|
## Heading 2 {MD003} ##
|
||||||
|
|
||||||
|
### Heading 3 ###
|
||||||
|
|
||||||
|
#### Heading 4 {MD003}
|
12
test/headings_surrounding_space_atx.md
Normal file
12
test/headings_surrounding_space_atx.md
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
# Heading 1
|
||||||
|
|
||||||
|
## Heading 2 {MD022}
|
||||||
|
Some text
|
||||||
|
## Heading 3 {MD022}
|
||||||
|
Some text
|
||||||
|
## Heading 4 {MD022}
|
||||||
|
|
||||||
|
## Heading 5
|
||||||
|
|
||||||
|
* This shouldn't trigger MD022, but did because of some bug where we tried to
|
||||||
|
#catch headings that kramdown didn't parse correctly.
|
15
test/headings_surrounding_space_setext.md
Normal file
15
test/headings_surrounding_space_setext.md
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
Heading 1
|
||||||
|
=========
|
||||||
|
|
||||||
|
Heading 2 {MD022}
|
||||||
|
-----------------
|
||||||
|
Some text {MD022} {MD025}
|
||||||
|
Heading 3
|
||||||
|
=================
|
||||||
|
Some text {MD022} {MD025}
|
||||||
|
Heading 4
|
||||||
|
=================
|
||||||
|
Some text
|
||||||
|
|
||||||
|
Heading 5
|
||||||
|
---------
|
|
@ -1,6 +1,6 @@
|
||||||
Some text
|
Some text
|
||||||
|
|
||||||
# Header 1 {MD023}
|
# Heading 1 {MD023}
|
||||||
|
|
||||||
Setext style fully indented {MD023}
|
Setext style fully indented {MD023}
|
||||||
===================================
|
===================================
|
||||||
|
@ -16,5 +16,5 @@ Some text
|
||||||
```
|
```
|
||||||
|
|
||||||
* This is another case where MD023 shouldn't be triggered
|
* This is another case where MD023 shouldn't be triggered
|
||||||
# Test {MD023} Valid header for CommonMark (see section 5.2)
|
# Test {MD023} Valid heading for CommonMark (see section 5.2)
|
||||||
# Test {MD023} Also valid header for CommonMark
|
# Test {MD023} Also valid heading for CommonMark
|
|
@ -4,4 +4,4 @@ draft = true
|
||||||
title = "Good to Great Book Review"
|
title = "Good to Great Book Review"
|
||||||
|
|
||||||
+++
|
+++
|
||||||
# Header 1
|
# Heading 1
|
||||||
|
|
|
@ -5,4 +5,4 @@ title = "Good to Great Book Review"
|
||||||
|
|
||||||
+++
|
+++
|
||||||
|
|
||||||
# Header 1 {MD041}
|
# Heading 1 {MD041}
|
||||||
|
|
|
@ -1,6 +0,0 @@
|
||||||
# Header 1 {MD003} #
|
|
||||||
|
|
||||||
## Header 2
|
|
||||||
|
|
||||||
Header 3 {MD003}
|
|
||||||
----------------
|
|
|
@ -1,6 +0,0 @@
|
||||||
# Header 1 #
|
|
||||||
|
|
||||||
## Header 2 {MD003}
|
|
||||||
|
|
||||||
Header 3 {MD003}
|
|
||||||
----------------
|
|
|
@ -1,6 +0,0 @@
|
||||||
# Header 1 {MD003} #
|
|
||||||
|
|
||||||
## Header 2 {MD003}
|
|
||||||
|
|
||||||
Header 3
|
|
||||||
--------
|
|
6
test/incorrect_heading_atx.md
Normal file
6
test/incorrect_heading_atx.md
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
# Heading 1 {MD003} #
|
||||||
|
|
||||||
|
## Heading 2
|
||||||
|
|
||||||
|
Heading 3 {MD003}
|
||||||
|
-----------------
|
6
test/incorrect_heading_atx_closed.md
Normal file
6
test/incorrect_heading_atx_closed.md
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
# Heading 1 #
|
||||||
|
|
||||||
|
## Heading 2 {MD003}
|
||||||
|
|
||||||
|
Heading 3 {MD003}
|
||||||
|
-----------------
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue