diff --git a/README.md b/README.md index 04dbec29..1f199688 100644 --- a/README.md +++ b/README.md @@ -46,9 +46,9 @@ playground for learning and exploring. ## Rules / Aliases -* **[MD001](doc/Rules.md#md001)** *header-increment* - Header 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 -* **[MD003](doc/Rules.md#md003)** *header-style* - Header style +* **[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-heading-h1, first-header-h1* - First heading should be a top level heading +* **[MD003](doc/Rules.md#md003)** *heading-style, header-style* - Heading 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 * **[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 * **[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 -* **[MD018](doc/Rules.md#md018)** *no-missing-space-atx* - No space after hash on atx style header -* **[MD019](doc/Rules.md#md019)** *no-multiple-space-atx* - Multiple spaces after hash on atx style header -* **[MD020](doc/Rules.md#md020)** *no-missing-space-closed-atx* - No space 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 header -* **[MD022](doc/Rules.md#md022)** *blanks-around-headers* - Headers should be surrounded by blank lines -* **[MD023](doc/Rules.md#md023)** *header-start-left* - Headers must start at the beginning of the line -* **[MD024](doc/Rules.md#md024)** *no-duplicate-header* - Multiple headers with the same content -* **[MD025](doc/Rules.md#md025)** *single-h1* - Multiple top level headers in the same document -* **[MD026](doc/Rules.md#md026)** *no-trailing-punctuation* - Trailing punctuation in 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 heading +* **[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 heading +* **[MD022](doc/Rules.md#md022)** *blanks-around-headings, blanks-around-headers* - Headings should be surrounded by blank lines +* **[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-heading, no-duplicate-header* - Multiple headings with the same content +* **[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 heading * **[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 * **[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 * **[MD034](doc/Rules.md#md034)** *no-bare-urls* - Bare URL used * **[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 * **[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 * **[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 -* **[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 * **[MD045](doc/Rules.md#md045)** *no-alt-text* - Images should have alternate text (alt text) 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 * **accessibility** - MD045 @@ -101,6 +105,8 @@ See [Rules.md](doc/Rules.md) for more details. * **code** - MD014, MD031, MD038, MD040 * **emphasis** - MD036, MD037 * **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, MD024, MD025, MD026, MD036, MD041, MD043 * **hr** - MD035 @@ -473,13 +479,13 @@ Output: ```text 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: 3: MD018/no-missing-space-atx No space after hash on atx style header [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: 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 heading [Context: "#This string fails some rules."] +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: 1: MD018/no-missing-space-atx No space after hash on atx style header [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: 1: MD041/first-line-h1 First line in file should be a top level 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 heading [Context: "#This file fails some rules."] +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: @@ -513,19 +519,19 @@ Output: "errorRange": [ 17, 1 ] }, { "lineNumber": 1, "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, "errorContext": "#bad.md", "errorRange": [ 1, 2 ] }, { "lineNumber": 3, "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, "errorContext": "#This file fails\tsome rules.", "errorRange": [ 1, 2 ] }, { "lineNumber": 1, "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, "errorContext": "#bad.md", "errorRange": null } @@ -561,9 +567,9 @@ Output: ```text [00:00:00] Starting 'markdownlint'... 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: 3: MD018/no-missing-space-atx No space after hash on atx style header [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: 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 heading [Context: "#This file fails some rules."] +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 ``` @@ -602,9 +608,9 @@ Output: Running "markdownlint:example" (markdownlint) task Warning: 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: 3: MD018/no-missing-space-atx No space after hash on atx style header [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: 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 heading [Context: "#This file fails some rules."] +bad.md: 1: MD041/first-line-h1 First line in file should be a top level heading [Context: "#bad.md"] Use --force to continue. ``` diff --git a/doc/Rules.md b/doc/Rules.md index a9e8b3d0..f1b4a3cb 100644 --- a/doc/Rules.md +++ b/doc/Rules.md @@ -6,62 +6,62 @@ versions of the examples. -## 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: ```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: ```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 ``` -## 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) -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 -## 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 -# Start with a H1 header +# Start with a H1 heading ## Then use a H2 for subsections ``` @@ -71,16 +71,16 @@ cases where an h1 is added externally. -## 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", "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: ```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 # 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 -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 Setext style H1 @@ -113,7 +113,7 @@ Setext style H2 ### 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 that the usage be consistent within the document. @@ -308,7 +308,7 @@ to allow this: ```markdown - list item text - + list item text ``` @@ -416,7 +416,9 @@ Tags: 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 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 being forced to break them in the middle. -You have the option to exclude this rule for code blocks, tables, or headers. -To do so, set the `code_blocks`, `tables`, or `headers` parameter(s) to false. +You have the option to exclude this rule for code blocks, tables, or headings. +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 requirement for document readability, and tentatively compatible with code @@ -478,185 +480,185 @@ for more information. -## 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 This rule is triggered when spaces are missing after the hash characters -in an atx style header: +in an atx style heading: ```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: ```markdown -# Header 1 +# Heading 1 -## Header 2 +## Heading 2 ``` -## 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 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 -# 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: ```markdown -# Header 1 +# Heading 1 -## Header 2 +## Heading 2 ``` -## 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 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 -#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: ```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. -## 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 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 -# 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: ```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. -## 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: ```markdown -# Header 1 +# Heading 1 Some text Some more text -## Header 2 +## Heading 2 ``` -To fix this, ensure that all headers have a blank line both before and after -(except where the header is at the beginning or end of the document): +To fix this, ensure that all headings have a blank line both before and after +(except where the heading is at the beginning or end of the document): ```markdown -# Header 1 +# Heading 1 Some text Some more text -## Header 2 +## Heading 2 ``` 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. -## 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 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 Some text -# Header +# Heading ``` -Rationale: Headers that don't start at the beginning of the line will not be -parsed as headers, and will instead appear as regular text. +Rationale: Headings that don't start at the beginning of the line will not be +parsed as headings, and will instead appear as regular text. -## 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: ```markdown @@ -665,7 +667,7 @@ the same 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 # Some text @@ -673,76 +675,76 @@ To fix this, ensure that the content of each header is different: ## Some more text ``` -Rationale: Some markdown parses generate anchors for headers based on the -header name, and having headers with the same content can cause problems with +Rationale: Some markdown parses generate anchors for headings based on the +heading name, and having headings with the same content can cause problems with this. -## 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 Parameters: level (number; default 1) -This rule is triggered when a top level header is in use (the first line of -the file is a h1 header), and more than one h1 header is in use in the +This rule is triggered when a top level heading is in use (the first line of +the file is a h1 heading), and more than one h1 heading is in use in the document: ```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 -the title for the document, and all later headers are h2 or lower level -headers: +To fix, structure your document so that there is a single h1 heading that is +the title for the document, and all later headings are h2 or lower level +headings: ```markdown # 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 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 cases where an h1 is added externally. -## MD026 - Trailing punctuation in header +## MD026 - Trailing punctuation in heading -Tags: headers +Tags: headings, headers Aliases: no-trailing-punctuation 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: ```markdown -# This is a header. +# This is a heading. ``` To fix this, remove any trailing punctuation: ```markdown -# This is a header +# This is a heading ``` 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 -`".,;:!"` to allow headers with question marks in them, such as might be used +as punctuation at the end of the heading. For example, you can set it to +`".,;:!"` to allow headings with question marks in them, such as might be used in an FAQ. @@ -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: ```markdown -
More inline HTML {MD033} but this time on multiple lines diff --git a/test/jekyll_post.md b/test/jekyll_post.md index 9c3980c3..38d24451 100644 --- a/test/jekyll_post.md +++ b/test/jekyll_post.md @@ -9,8 +9,8 @@ tags: url: http://example.com excerpt: Hello World! Vestibulum imperdiet adipiscing arcu, quis aliquam dolor condimentum dapibus. Aliquam fermentum leo aliquet quam volutpat et molestie mauris mattis. Suspendisse semper consequat velit in suscipit. --- -# header1 +# heading1 This is just a sample post. -### offending header3 {MD001} +### offending heading3 {MD001} diff --git a/test/lists-and-headers.md b/test/lists-and-headings.md similarity index 68% rename from test/lists-and-headers.md rename to test/lists-and-headings.md index e8ccd3e7..dc23f139 100644 --- a/test/lists-and-headers.md +++ b/test/lists-and-headings.md @@ -3,18 +3,18 @@ * list * list -# Header 1 +# Heading 1 * list * list -# Header 2 # +# Heading 2 # * list * list -Header 3 -======== +Heading 3 +========= * list * list diff --git a/test/long-header-exceptions.json b/test/long-heading-exceptions.json similarity index 64% rename from test/long-header-exceptions.json rename to test/long-heading-exceptions.json index 6af9f257..0ee0cc1c 100644 --- a/test/long-header-exceptions.json +++ b/test/long-heading-exceptions.json @@ -1,6 +1,6 @@ { "default": true, "MD013": { - "headers": false + "headings": false } } diff --git a/test/long-header-exceptions.md b/test/long-heading-exceptions.md similarity index 57% rename from test/long-header-exceptions.md rename to test/long-heading-exceptions.md index ce5dba99..f072544a 100644 --- a/test/long-header-exceptions.md +++ b/test/long-heading-exceptions.md @@ -1,20 +1,20 @@ -# Header +# Heading Text -## Header header header header header header header header header header header header header header header header +## Heading heading heading heading heading heading heading heading heading heading heading heading heading heading heading heading Text Text text text text text text text text text text text text text text text text text text text text text text text text {MD013} -## Header header +## Heading heading Text Text text text text text text text text text text text text text text text text text text text text text text text text {MD013} -### Header header header header header header header header header header header header header header header header header +### Heading heading heading heading heading heading heading heading heading heading heading heading heading heading heading heading heading Text diff --git a/test/long_lines_code-default.md b/test/long_lines_code-default.md index f90eab79..2d81f169 100644 --- a/test/long_lines_code-default.md +++ b/test/long_lines_code-default.md @@ -11,18 +11,18 @@ Here is a very very very very very very very very very very very very very very This is a short line. -| First Header | Second Header | Third Header | Fourth Header | Fifth Header | Sixth Header | {MD013} -| ------------- | ------------- | ------------- | ------------- | ------------- | ------------- | {MD013} -| Content Cell | Content Cell | Content Cell | Content Cell | Content Cell | Content Cell | {MD013} -| ============= | ============= | ============= | ============= | ============= | ============= | {MD013} -| Footer Cell | Footer Cell | Footer Cell | Footer Cell | Footer Cell | Footer Cell | {MD013} +| First Heading | Second Heading | Third Heading | Fourth Heading | Fifth Heading | Sixth Heading | {MD013} +| -------------- | -------------- | -------------- | -------------- | -------------- | -------------- | {MD013} +| Content Cell | Content Cell | Content Cell | Content Cell | Content Cell | Content Cell | {MD013} +| ============== | ============== | ============== | ============== | ============== | ============== | {MD013} +| Footer Cell | Footer Cell | Footer Cell | Footer Cell | Footer Cell | Footer Cell | {MD013} This is a very very very very very very very very very very very very very very very very very very very very long line. {MD013} Another line. -| First Header | Second Header | Third Header | Fourth Header | Fifth Header | Sixth Header | {MD013} -| ------------- | ------------- | ------------- | ------------- | ------------- | ------------- | {MD013} -| Content Cell | Content Cell | Content Cell | Content Cell | Content Cell | Content Cell | {MD013} -| ============= | ============= | ============= | ============= | ============= | ============= | {MD013} -| Footer Cell | Footer Cell | Footer Cell | Footer Cell | Footer Cell | Footer Cell | {MD013} +| First Heading | Second Heading | Third Heading | Fourth Heading | Fifth Heading | Sixth Heading | {MD013} +| -------------- | -------------- | -------------- | -------------- | -------------- | -------------- | {MD013} +| Content Cell | Content Cell | Content Cell | Content Cell | Content Cell | Content Cell | {MD013} +| ============== | ============== | ============== | ============== | ============== | ============== | {MD013} +| Footer Cell | Footer Cell | Footer Cell | Footer Cell | Footer Cell | Footer Cell | {MD013} diff --git a/test/long_lines_code.md b/test/long_lines_code.md index 633249eb..9481ee56 100644 --- a/test/long_lines_code.md +++ b/test/long_lines_code.md @@ -18,28 +18,28 @@ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor i This is a short line. -| First Header | Second Header | Third Header | Fourth Header | Fifth Header | Sixth Header | -| ------------- | ------------- | ------------- | ------------- | ------------- | ------------- | -| Content Cell | Content Cell | Content Cell | Content Cell | Content Cell | Content Cell | -| Content Cell | Content Cell | Content Cell | Content Cell | Content Cell | Content Cell | -| ------------- | ------------- | ------------- | ------------- | ------------- | ------------- | -| Content Cell | Content Cell | Content Cell | Content Cell | Content Cell | Content Cell | -| Content Cell | Content Cell | Content Cell | Content Cell | Content Cell | Content Cell | -| ============= | ============= | ============= | ============= | ============= | ============= | -| Footer Cell | Footer Cell | Footer Cell | Footer Cell | Footer Cell | Footer Cell | +| First Heading | Second Heading | Third Heading | Fourth Heading | Fifth Heading | Sixth Heading | +| -------------- | -------------- | -------------- | -------------- | -------------- | -------------- | +| Content Cell | Content Cell | Content Cell | Content Cell | Content Cell | Content Cell | +| Content Cell | Content Cell | Content Cell | Content Cell | Content Cell | Content Cell | +| -------------- | -------------- | -------------- | -------------- | -------------- | -------------- | +| Content Cell | Content Cell | Content Cell | Content Cell | Content Cell | Content Cell | +| Content Cell | Content Cell | Content Cell | Content Cell | Content Cell | Content Cell | +| ============== | ============== | ============== | ============== | ============== | ============== | +| Footer Cell | Footer Cell | Footer Cell | Footer Cell | Footer Cell | Footer Cell | {: rules="groups"} This is a very very very very very very very very very very very very very very very very very very very very long line. {MD013} Another line. -| First Header | Second Header | Third Header | Fourth Header | Fifth Header | Sixth Header | -| ------------- | ------------- | ------------- | ------------- | ------------- | ------------- | -| Content Cell | Content Cell | Content Cell | Content Cell | Content Cell | Content Cell | -| Content Cell | Content Cell | Content Cell | Content Cell | Content Cell | Content Cell | -| ------------- | ------------- | ------------- | ------------- | ------------- | ------------- | -| Content Cell | Content Cell | Content Cell | Content Cell | Content Cell | Content Cell | -| Content Cell | Content Cell | Content Cell | Content Cell | Content Cell | Content Cell | -| ============= | ============= | ============= | ============= | ============= | ============= | -| Footer Cell | Footer Cell | Footer Cell | Footer Cell | Footer Cell | Footer Cell | +| First Heading | Second Heading | Third Heading | Fourth Heading | Fifth Heading | Sixth Heading | +| -------------- | -------------- | -------------- | -------------- | -------------- | -------------- | +| Content Cell | Content Cell | Content Cell | Content Cell | Content Cell | Content Cell | +| Content Cell | Content Cell | Content Cell | Content Cell | Content Cell | Content Cell | +| -------------- | -------------- | -------------- | -------------- | -------------- | -------------- | +| Content Cell | Content Cell | Content Cell | Content Cell | Content Cell | Content Cell | +| Content Cell | Content Cell | Content Cell | Content Cell | Content Cell | Content Cell | +| ============== | ============== | ============== | ============== | ============== | ============== | +| Footer Cell | Footer Cell | Footer Cell | Footer Cell | Footer Cell | Footer Cell | {: rules="groups"} diff --git a/test/markdown-extra-footnote.md b/test/markdown-extra-footnote.md index 2c7aafe7..101b9964 100644 --- a/test/markdown-extra-footnote.md +++ b/test/markdown-extra-footnote.md @@ -1,4 +1,4 @@ -# Header +# Heading Text with Markdown Extra footnote[^1] diff --git a/test/markdownlint-test.js b/test/markdownlint-test.js index bee4a174..3a9bc175 100644 --- a/test/markdownlint-test.js +++ b/test/markdownlint-test.js @@ -101,8 +101,8 @@ module.exports.resultFormattingV0 = function resultFormattingV0(test) { test.expect(4); var options = { "files": [ - "./test/atx_header_spacing.md", - "./test/first_header_bad_atx.md" + "./test/atx_heading_spacing.md", + "./test/first_heading_bad_atx.md" ], "config": defaultConfig, "resultVersion": 0 @@ -110,41 +110,41 @@ module.exports.resultFormattingV0 = function resultFormattingV0(test) { markdownlint(options, function callback(err, actualResult) { test.ifError(err); var expectedResult = { - "./test/atx_header_spacing.md": { + "./test/atx_heading_spacing.md": { "MD002": [ 3 ], "MD018": [ 1 ], "MD019": [ 3, 5 ] }, - "./test/first_header_bad_atx.md": { + "./test/first_heading_bad_atx.md": { "MD002": [ 1 ] } }; test.deepEqual(actualResult, expectedResult, "Undetected issues."); var actualMessage = actualResult.toString(); var expectedMessage = - "./test/atx_header_spacing.md: 3: MD002" + - " First header should be a top level header\n" + - "./test/atx_header_spacing.md: 1: MD018" + - " No space after hash on atx style header\n" + - "./test/atx_header_spacing.md: 3: MD019" + - " Multiple spaces after hash on atx style header\n" + - "./test/atx_header_spacing.md: 5: MD019" + - " Multiple spaces after hash on atx style header\n" + - "./test/first_header_bad_atx.md: 1: MD002" + - " First header should be a top level header"; + "./test/atx_heading_spacing.md: 3: MD002" + + " First heading should be a top level heading\n" + + "./test/atx_heading_spacing.md: 1: MD018" + + " No space after hash on atx style heading\n" + + "./test/atx_heading_spacing.md: 3: MD019" + + " Multiple spaces after hash on atx style heading\n" + + "./test/atx_heading_spacing.md: 5: MD019" + + " Multiple spaces after hash on atx style heading\n" + + "./test/first_heading_bad_atx.md: 1: MD002" + + " First heading should be a top level heading"; test.equal(actualMessage, expectedMessage, "Incorrect message (name)."); actualMessage = actualResult.toString(true); expectedMessage = - "./test/atx_header_spacing.md: 3: first-header-h1" + - " First header should be a top level header\n" + - "./test/atx_header_spacing.md: 1: no-missing-space-atx" + - " No space after hash on atx style header\n" + - "./test/atx_header_spacing.md: 3: no-multiple-space-atx" + - " Multiple spaces after hash on atx style header\n" + - "./test/atx_header_spacing.md: 5: no-multiple-space-atx" + - " Multiple spaces after hash on atx style header\n" + - "./test/first_header_bad_atx.md: 1: first-header-h1" + - " First header should be a top level header"; + "./test/atx_heading_spacing.md: 3: first-heading-h1" + + " First heading should be a top level heading\n" + + "./test/atx_heading_spacing.md: 1: no-missing-space-atx" + + " No space after hash on atx style heading\n" + + "./test/atx_heading_spacing.md: 3: no-multiple-space-atx" + + " Multiple spaces after hash on atx style heading\n" + + "./test/atx_heading_spacing.md: 5: no-multiple-space-atx" + + " Multiple spaces after hash on atx style heading\n" + + "./test/first_heading_bad_atx.md: 1: first-heading-h1" + + " First heading should be a top level heading"; test.equal(actualMessage, expectedMessage, "Incorrect message (alias)."); test.done(); }); @@ -154,49 +154,49 @@ module.exports.resultFormattingSyncV0 = function resultFormattingSyncV0(test) { test.expect(3); var options = { "files": [ - "./test/atx_header_spacing.md", - "./test/first_header_bad_atx.md" + "./test/atx_heading_spacing.md", + "./test/first_heading_bad_atx.md" ], "config": defaultConfig, "resultVersion": 0 }; var actualResult = markdownlint.sync(options); var expectedResult = { - "./test/atx_header_spacing.md": { + "./test/atx_heading_spacing.md": { "MD002": [ 3 ], "MD018": [ 1 ], "MD019": [ 3, 5 ] }, - "./test/first_header_bad_atx.md": { + "./test/first_heading_bad_atx.md": { "MD002": [ 1 ] } }; test.deepEqual(actualResult, expectedResult, "Undetected issues."); var actualMessage = actualResult.toString(); var expectedMessage = - "./test/atx_header_spacing.md: 3: MD002" + - " First header should be a top level header\n" + - "./test/atx_header_spacing.md: 1: MD018" + - " No space after hash on atx style header\n" + - "./test/atx_header_spacing.md: 3: MD019" + - " Multiple spaces after hash on atx style header\n" + - "./test/atx_header_spacing.md: 5: MD019" + - " Multiple spaces after hash on atx style header\n" + - "./test/first_header_bad_atx.md: 1: MD002" + - " First header should be a top level header"; + "./test/atx_heading_spacing.md: 3: MD002" + + " First heading should be a top level heading\n" + + "./test/atx_heading_spacing.md: 1: MD018" + + " No space after hash on atx style heading\n" + + "./test/atx_heading_spacing.md: 3: MD019" + + " Multiple spaces after hash on atx style heading\n" + + "./test/atx_heading_spacing.md: 5: MD019" + + " Multiple spaces after hash on atx style heading\n" + + "./test/first_heading_bad_atx.md: 1: MD002" + + " First heading should be a top level heading"; test.equal(actualMessage, expectedMessage, "Incorrect message (name)."); actualMessage = actualResult.toString(true); expectedMessage = - "./test/atx_header_spacing.md: 3: first-header-h1" + - " First header should be a top level header\n" + - "./test/atx_header_spacing.md: 1: no-missing-space-atx" + - " No space after hash on atx style header\n" + - "./test/atx_header_spacing.md: 3: no-multiple-space-atx" + - " Multiple spaces after hash on atx style header\n" + - "./test/atx_header_spacing.md: 5: no-multiple-space-atx" + - " Multiple spaces after hash on atx style header\n" + - "./test/first_header_bad_atx.md: 1: first-header-h1" + - " First header should be a top level header"; + "./test/atx_heading_spacing.md: 3: first-heading-h1" + + " First heading should be a top level heading\n" + + "./test/atx_heading_spacing.md: 1: no-missing-space-atx" + + " No space after hash on atx style heading\n" + + "./test/atx_heading_spacing.md: 3: no-multiple-space-atx" + + " Multiple spaces after hash on atx style heading\n" + + "./test/atx_heading_spacing.md: 5: no-multiple-space-atx" + + " Multiple spaces after hash on atx style heading\n" + + "./test/first_heading_bad_atx.md: 1: first-heading-h1" + + " First heading should be a top level heading"; test.equal(actualMessage, expectedMessage, "Incorrect message (alias)."); test.done(); }; @@ -206,11 +206,11 @@ module.exports.resultFormattingV1 = function resultFormattingV1(test) { var options = { "strings": { "truncate": - "# Multiple spaces inside hashes on closed atx style header #" + "# Multiple spaces inside hashes on closed atx style heading #" }, "files": [ - "./test/atx_header_spacing.md", - "./test/first_header_bad_atx.md" + "./test/atx_heading_spacing.md", + "./test/first_heading_bad_atx.md" ], "config": defaultConfig, "resultVersion": 1 @@ -223,46 +223,46 @@ module.exports.resultFormattingV1 = function resultFormattingV1(test) { "ruleName": "MD021", "ruleAlias": "no-multiple-space-closed-atx", "ruleDescription": - "Multiple spaces inside hashes on closed atx style header", + "Multiple spaces inside hashes on closed atx style heading", "errorDetail": null, - "errorContext": "# Multiple spa...style header #", + "errorContext": "# Multiple spa...tyle heading #", "errorRange": [ 1, 4 ] } ], - "./test/atx_header_spacing.md": [ + "./test/atx_heading_spacing.md": [ { "lineNumber": 3, "ruleName": "MD002", - "ruleAlias": "first-header-h1", - "ruleDescription": "First header should be a top level header", + "ruleAlias": "first-heading-h1", + "ruleDescription": "First heading should be a top level heading", "errorDetail": "Expected: h1; Actual: h2", "errorContext": null, "errorRange": null }, { "lineNumber": 1, "ruleName": "MD018", "ruleAlias": "no-missing-space-atx", - "ruleDescription": "No space after hash on atx style header", + "ruleDescription": "No space after hash on atx style heading", "errorDetail": null, - "errorContext": "#Header 1 {MD018}", + "errorContext": "#Heading 1 {MD018}", "errorRange": [ 1, 2 ] }, { "lineNumber": 3, "ruleName": "MD019", "ruleAlias": "no-multiple-space-atx", - "ruleDescription": "Multiple spaces after hash on atx style header", + "ruleDescription": "Multiple spaces after hash on atx style heading", "errorDetail": null, - "errorContext": "## Header 2 {MD019}", + "errorContext": "## Heading 2 {MD019}", "errorRange": [ 1, 5 ] }, { "lineNumber": 5, "ruleName": "MD019", "ruleAlias": "no-multiple-space-atx", - "ruleDescription": "Multiple spaces after hash on atx style header", + "ruleDescription": "Multiple spaces after hash on atx style heading", "errorDetail": null, - "errorContext": "## Header 3 {MD019}", + "errorContext": "## Heading 3 {MD019}", "errorRange": [ 1, 6 ] } ], - "./test/first_header_bad_atx.md": [ + "./test/first_heading_bad_atx.md": [ { "lineNumber": 1, "ruleName": "MD002", - "ruleAlias": "first-header-h1", - "ruleDescription": "First header should be a top level header", + "ruleAlias": "first-heading-h1", + "ruleDescription": "First heading should be a top level heading", "errorDetail": "Expected: h1; Actual: h2", "errorContext": null, "errorRange": null } @@ -272,22 +272,22 @@ module.exports.resultFormattingV1 = function resultFormattingV1(test) { var actualMessage = actualResult.toString(); var expectedMessage = "truncate: 1: MD021/no-multiple-space-closed-atx" + - " Multiple spaces inside hashes on closed atx style header" + - " [Context: \"# Multiple spa...style header #\"]\n" + - "./test/atx_header_spacing.md: 3: MD002/first-header-h1" + - " First header should be a top level header" + + " Multiple spaces inside hashes on closed atx style heading" + + " [Context: \"# Multiple spa...tyle heading #\"]\n" + + "./test/atx_heading_spacing.md: 3: MD002/first-heading-h1" + + " First heading should be a top level heading" + " [Expected: h1; Actual: h2]\n" + - "./test/atx_header_spacing.md: 1: MD018/no-missing-space-atx" + - " No space after hash on atx style header" + - " [Context: \"#Header 1 {MD018}\"]\n" + - "./test/atx_header_spacing.md: 3: MD019/no-multiple-space-atx" + - " Multiple spaces after hash on atx style header" + - " [Context: \"## Header 2 {MD019}\"]\n" + - "./test/atx_header_spacing.md: 5: MD019/no-multiple-space-atx" + - " Multiple spaces after hash on atx style header" + - " [Context: \"## Header 3 {MD019}\"]\n" + - "./test/first_header_bad_atx.md: 1: MD002/first-header-h1" + - " First header should be a top level header" + + "./test/atx_heading_spacing.md: 1: MD018/no-missing-space-atx" + + " No space after hash on atx style heading" + + " [Context: \"#Heading 1 {MD018}\"]\n" + + "./test/atx_heading_spacing.md: 3: MD019/no-multiple-space-atx" + + " Multiple spaces after hash on atx style heading" + + " [Context: \"## Heading 2 {MD019}\"]\n" + + "./test/atx_heading_spacing.md: 5: MD019/no-multiple-space-atx" + + " Multiple spaces after hash on atx style heading" + + " [Context: \"## Heading 3 {MD019}\"]\n" + + "./test/first_heading_bad_atx.md: 1: MD002/first-heading-h1" + + " First heading should be a top level heading" + " [Expected: h1; Actual: h2]"; test.equal(actualMessage, expectedMessage, "Incorrect message."); test.done(); @@ -299,11 +299,11 @@ module.exports.resultFormattingV2 = function resultFormattingV2(test) { var options = { "strings": { "truncate": - "# Multiple spaces inside hashes on closed atx style header #" + "# Multiple spaces inside hashes on closed atx style heading #" }, "files": [ - "./test/atx_header_spacing.md", - "./test/first_header_bad_atx.md" + "./test/atx_heading_spacing.md", + "./test/first_heading_bad_atx.md" ], "config": defaultConfig }; @@ -314,41 +314,41 @@ module.exports.resultFormattingV2 = function resultFormattingV2(test) { { "lineNumber": 1, "ruleNames": [ "MD021", "no-multiple-space-closed-atx" ], "ruleDescription": - "Multiple spaces inside hashes on closed atx style header", + "Multiple spaces inside hashes on closed atx style heading", "errorDetail": null, - "errorContext": "# Multiple spa...style header #", + "errorContext": "# Multiple spa...tyle heading #", "errorRange": [ 1, 4 ] } ], - "./test/atx_header_spacing.md": [ + "./test/atx_heading_spacing.md": [ { "lineNumber": 3, - "ruleNames": [ "MD002", "first-header-h1" ], - "ruleDescription": "First header should be a top level header", + "ruleNames": [ "MD002", "first-heading-h1", "first-header-h1" ], + "ruleDescription": "First heading should be a top level heading", "errorDetail": "Expected: h1; Actual: h2", "errorContext": null, "errorRange": null }, { "lineNumber": 1, "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, - "errorContext": "#Header 1 {MD018}", + "errorContext": "#Heading 1 {MD018}", "errorRange": [ 1, 2 ] }, { "lineNumber": 3, "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, - "errorContext": "## Header 2 {MD019}", + "errorContext": "## Heading 2 {MD019}", "errorRange": [ 1, 5 ] }, { "lineNumber": 5, "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, - "errorContext": "## Header 3 {MD019}", + "errorContext": "## Heading 3 {MD019}", "errorRange": [ 1, 6 ] } ], - "./test/first_header_bad_atx.md": [ + "./test/first_heading_bad_atx.md": [ { "lineNumber": 1, - "ruleNames": [ "MD002", "first-header-h1" ], - "ruleDescription": "First header should be a top level header", + "ruleNames": [ "MD002", "first-heading-h1", "first-header-h1" ], + "ruleDescription": "First heading should be a top level heading", "errorDetail": "Expected: h1; Actual: h2", "errorContext": null, "errorRange": null } @@ -358,22 +358,24 @@ module.exports.resultFormattingV2 = function resultFormattingV2(test) { var actualMessage = actualResult.toString(); var expectedMessage = "truncate: 1: MD021/no-multiple-space-closed-atx" + - " Multiple spaces inside hashes on closed atx style header" + - " [Context: \"# Multiple spa...style header #\"]\n" + - "./test/atx_header_spacing.md: 3: MD002/first-header-h1" + - " First header should be a top level header" + + " Multiple spaces inside hashes on closed atx style heading" + + " [Context: \"# Multiple spa...tyle heading #\"]\n" + + "./test/atx_heading_spacing.md: 3:" + + " MD002/first-heading-h1/first-header-h1" + + " First heading should be a top level heading" + " [Expected: h1; Actual: h2]\n" + - "./test/atx_header_spacing.md: 1: MD018/no-missing-space-atx" + - " No space after hash on atx style header" + - " [Context: \"#Header 1 {MD018}\"]\n" + - "./test/atx_header_spacing.md: 3: MD019/no-multiple-space-atx" + - " Multiple spaces after hash on atx style header" + - " [Context: \"## Header 2 {MD019}\"]\n" + - "./test/atx_header_spacing.md: 5: MD019/no-multiple-space-atx" + - " Multiple spaces after hash on atx style header" + - " [Context: \"## Header 3 {MD019}\"]\n" + - "./test/first_header_bad_atx.md: 1: MD002/first-header-h1" + - " First header should be a top level header" + + "./test/atx_heading_spacing.md: 1: MD018/no-missing-space-atx" + + " No space after hash on atx style heading" + + " [Context: \"#Heading 1 {MD018}\"]\n" + + "./test/atx_heading_spacing.md: 3: MD019/no-multiple-space-atx" + + " Multiple spaces after hash on atx style heading" + + " [Context: \"## Heading 2 {MD019}\"]\n" + + "./test/atx_heading_spacing.md: 5: MD019/no-multiple-space-atx" + + " Multiple spaces after hash on atx style heading" + + " [Context: \"## Heading 3 {MD019}\"]\n" + + "./test/first_heading_bad_atx.md: 1:" + + " MD002/first-heading-h1/first-header-h1" + + " First heading should be a top level heading" + " [Expected: h1; Actual: h2]"; test.equal(actualMessage, expectedMessage, "Incorrect message."); test.done(); @@ -433,8 +435,8 @@ module.exports.defaultTrue = function defaultTrue(test) { test.expect(2); var options = { "files": [ - "./test/atx_header_spacing.md", - "./test/first_header_bad_atx.md" + "./test/atx_heading_spacing.md", + "./test/first_heading_bad_atx.md" ], "config": { "default": true @@ -444,13 +446,13 @@ module.exports.defaultTrue = function defaultTrue(test) { markdownlint(options, function callback(err, actualResult) { test.ifError(err); var expectedResult = { - "./test/atx_header_spacing.md": { + "./test/atx_heading_spacing.md": { "MD002": [ 3 ], "MD018": [ 1 ], "MD019": [ 3, 5 ], "MD041": [ 1 ] }, - "./test/first_header_bad_atx.md": { + "./test/first_heading_bad_atx.md": { "MD002": [ 1 ], "MD041": [ 1 ] } @@ -464,8 +466,8 @@ module.exports.defaultFalse = function defaultFalse(test) { test.expect(2); var options = { "files": [ - "./test/atx_header_spacing.md", - "./test/first_header_bad_atx.md" + "./test/atx_heading_spacing.md", + "./test/first_heading_bad_atx.md" ], "config": { "default": false @@ -475,8 +477,8 @@ module.exports.defaultFalse = function defaultFalse(test) { markdownlint(options, function callback(err, actualResult) { test.ifError(err); var expectedResult = { - "./test/atx_header_spacing.md": {}, - "./test/first_header_bad_atx.md": {} + "./test/atx_heading_spacing.md": {}, + "./test/first_heading_bad_atx.md": {} }; test.deepEqual(actualResult, expectedResult, "Undetected issues."); test.done(); @@ -487,8 +489,8 @@ module.exports.defaultUndefined = function defaultUndefined(test) { test.expect(2); var options = { "files": [ - "./test/atx_header_spacing.md", - "./test/first_header_bad_atx.md" + "./test/atx_heading_spacing.md", + "./test/first_heading_bad_atx.md" ], "config": {}, "resultVersion": 0 @@ -496,13 +498,13 @@ module.exports.defaultUndefined = function defaultUndefined(test) { markdownlint(options, function callback(err, actualResult) { test.ifError(err); var expectedResult = { - "./test/atx_header_spacing.md": { + "./test/atx_heading_spacing.md": { "MD002": [ 3 ], "MD018": [ 1 ], "MD019": [ 3, 5 ], "MD041": [ 1 ] }, - "./test/first_header_bad_atx.md": { + "./test/first_heading_bad_atx.md": { "MD002": [ 1 ], "MD041": [ 1 ] } @@ -516,8 +518,8 @@ module.exports.disableRules = function disableRules(test) { test.expect(2); var options = { "files": [ - "./test/atx_header_spacing.md", - "./test/first_header_bad_atx.md" + "./test/atx_heading_spacing.md", + "./test/first_heading_bad_atx.md" ], "config": { "MD002": false, @@ -530,10 +532,10 @@ module.exports.disableRules = function disableRules(test) { markdownlint(options, function callback(err, actualResult) { test.ifError(err); var expectedResult = { - "./test/atx_header_spacing.md": { + "./test/atx_heading_spacing.md": { "MD018": [ 1 ] }, - "./test/first_header_bad_atx.md": {} + "./test/first_heading_bad_atx.md": {} }; test.deepEqual(actualResult, expectedResult, "Undetected issues."); test.done(); @@ -544,8 +546,8 @@ module.exports.enableRules = function enableRules(test) { test.expect(2); var options = { "files": [ - "./test/atx_header_spacing.md", - "./test/first_header_bad_atx.md" + "./test/atx_heading_spacing.md", + "./test/first_heading_bad_atx.md" ], "config": { "MD002": true, @@ -557,11 +559,11 @@ module.exports.enableRules = function enableRules(test) { markdownlint(options, function callback(err, actualResult) { test.ifError(err); var expectedResult = { - "./test/atx_header_spacing.md": { + "./test/atx_heading_spacing.md": { "MD002": [ 3 ], "MD019": [ 3, 5 ] }, - "./test/first_header_bad_atx.md": { + "./test/first_heading_bad_atx.md": { "MD002": [ 1 ] } }; @@ -574,8 +576,8 @@ module.exports.enableRulesMixedCase = function enableRulesMixedCase(test) { test.expect(2); var options = { "files": [ - "./test/atx_header_spacing.md", - "./test/first_header_bad_atx.md" + "./test/atx_heading_spacing.md", + "./test/first_heading_bad_atx.md" ], "config": { "Md002": true, @@ -587,11 +589,11 @@ module.exports.enableRulesMixedCase = function enableRulesMixedCase(test) { markdownlint(options, function callback(err, actualResult) { test.ifError(err); var expectedResult = { - "./test/atx_header_spacing.md": { + "./test/atx_heading_spacing.md": { "MD002": [ 3 ], "MD019": [ 3, 5 ] }, - "./test/first_header_bad_atx.md": { + "./test/first_heading_bad_atx.md": { "MD002": [ 1 ] } }; @@ -604,8 +606,8 @@ module.exports.disableTag = function disableTag(test) { test.expect(2); var options = { "files": [ - "./test/atx_header_spacing.md", - "./test/first_header_bad_atx.md" + "./test/atx_heading_spacing.md", + "./test/first_heading_bad_atx.md" ], "config": { "default": true, @@ -616,11 +618,11 @@ module.exports.disableTag = function disableTag(test) { markdownlint(options, function callback(err, actualResult) { test.ifError(err); var expectedResult = { - "./test/atx_header_spacing.md": { + "./test/atx_heading_spacing.md": { "MD002": [ 3 ], "MD041": [ 1 ] }, - "./test/first_header_bad_atx.md": { + "./test/first_heading_bad_atx.md": { "MD002": [ 1 ], "MD041": [ 1 ] } @@ -634,8 +636,8 @@ module.exports.enableTag = function enableTag(test) { test.expect(2); var options = { "files": [ - "./test/atx_header_spacing.md", - "./test/first_header_bad_atx.md" + "./test/atx_heading_spacing.md", + "./test/first_heading_bad_atx.md" ], "config": { "default": false, @@ -647,11 +649,11 @@ module.exports.enableTag = function enableTag(test) { markdownlint(options, function callback(err, actualResult) { test.ifError(err); var expectedResult = { - "./test/atx_header_spacing.md": { + "./test/atx_heading_spacing.md": { "MD018": [ 1 ], "MD019": [ 3, 5 ] }, - "./test/first_header_bad_atx.md": {} + "./test/first_heading_bad_atx.md": {} }; test.deepEqual(actualResult, expectedResult, "Undetected issues."); test.done(); @@ -662,8 +664,8 @@ module.exports.enableTagMixedCase = function enableTagMixedCase(test) { test.expect(2); var options = { "files": [ - "./test/atx_header_spacing.md", - "./test/first_header_bad_atx.md" + "./test/atx_heading_spacing.md", + "./test/first_heading_bad_atx.md" ], "config": { "DeFaUlT": false, @@ -675,11 +677,11 @@ module.exports.enableTagMixedCase = function enableTagMixedCase(test) { markdownlint(options, function callback(err, actualResult) { test.ifError(err); var expectedResult = { - "./test/atx_header_spacing.md": { + "./test/atx_heading_spacing.md": { "MD018": [ 1 ], "MD019": [ 3, 5 ] }, - "./test/first_header_bad_atx.md": {} + "./test/first_heading_bad_atx.md": {} }; test.deepEqual(actualResult, expectedResult, "Undetected issues."); test.done(); @@ -797,7 +799,7 @@ module.exports.nullFrontMatter = function nullFrontMatter(test) { test.expect(2); markdownlint({ "strings": { - "content": "---\n\t\n---\n# Header\n" + "content": "---\n\t\n---\n# Heading\n" }, "frontMatter": null, "config": { @@ -819,7 +821,7 @@ module.exports.customFrontMatter = function customFrontMatter(test) { test.expect(2); markdownlint({ "strings": { - "content": "
\n\t\n\n# Header\n" + "content": "\n\t\n\n# Heading\n" }, "frontMatter": /[^]*<\/head>/, "config": { @@ -868,7 +870,7 @@ module.exports.noInlineConfig = function noInlineConfig(test) { }); }; -module.exports.readmeHeaders = function readmeHeaders(test) { +module.exports.readmeHeadings = function readmeHeadings(test) { test.expect(2); markdownlint({ "files": "README.md", @@ -879,7 +881,7 @@ module.exports.readmeHeaders = function readmeHeaders(test) { "line_length": 150 }, "MD043": { - "headers": [ + "headings": [ "# markdownlint", "## Install", "## Overview", @@ -922,8 +924,8 @@ module.exports.readmeHeaders = function readmeHeaders(test) { module.exports.filesArrayNotModified = function filesArrayNotModified(test) { test.expect(2); var files = [ - "./test/atx_header_spacing.md", - "./test/first_header_bad_atx.md" + "./test/atx_heading_spacing.md", + "./test/first_heading_bad_atx.md" ]; var expectedFiles = files.slice(); markdownlint({ "files": files }, function callback(err) { @@ -1024,7 +1026,7 @@ module.exports.missingStringValue = function missingStringValue(test) { }; module.exports.readme = function readme(test) { - test.expect(108); + test.expect(109); var tagToRules = {}; rules.forEach(function forRule(rule) { rule.tags.forEach(function forTag(tag) { diff --git a/test/md004-list-items-in-blockquote.md b/test/md004-list-items-in-blockquote.md index fc182ceb..0b95d9dd 100644 --- a/test/md004-list-items-in-blockquote.md +++ b/test/md004-list-items-in-blockquote.md @@ -1,4 +1,4 @@ -# Header +# Heading Text diff --git a/test/md033-cannot-read-property-of-undefined.md b/test/md033-cannot-read-property-of-undefined.md index 6a663739..8b1d1838 100644 --- a/test/md033-cannot-read-property-of-undefined.md +++ b/test/md033-cannot-read-property-of-undefined.md @@ -1,4 +1,4 @@ -# Header +# Heading Head | Head --------|------------ diff --git a/test/md036-emphasis-as-header.md b/test/md036-emphasis-as-heading.md similarity index 75% rename from test/md036-emphasis-as-header.md rename to test/md036-emphasis-as-heading.md index a1877883..a2fe1252 100644 --- a/test/md036-emphasis-as-header.md +++ b/test/md036-emphasis-as-heading.md @@ -4,7 +4,7 @@ * **Emphasized item** * Item -_Emphasis as header {MD036}_ +_Emphasis as heading {MD036}_ 1. **Emphasized item** * Item @@ -14,4 +14,4 @@ _Emphasis as header {MD036}_ * **Emphasized item** * Item -**Emphasis as header {MD036}** +**Emphasis as heading {MD036}** diff --git a/test/mixed_header_types_atx.md b/test/mixed_header_types_atx.md deleted file mode 100644 index 9e66f992..00000000 --- a/test/mixed_header_types_atx.md +++ /dev/null @@ -1,6 +0,0 @@ -# Header - -## Header 2 {MD003} ## - -Header 3 {MD003} ----------------- \ No newline at end of file diff --git a/test/mixed_header_types_atx_closed.md b/test/mixed_header_types_atx_closed.md deleted file mode 100644 index fdd549dc..00000000 --- a/test/mixed_header_types_atx_closed.md +++ /dev/null @@ -1,6 +0,0 @@ -# Header 1 # - -## Header 2 {MD003} - -Header 3 {MD003} ----------------- \ No newline at end of file diff --git a/test/mixed_header_types_setext.md b/test/mixed_header_types_setext.md deleted file mode 100644 index 1a4d8891..00000000 --- a/test/mixed_header_types_setext.md +++ /dev/null @@ -1,6 +0,0 @@ -Header 1 -======== - -## Header 2 {MD003} - -## Header 3 {MD003} ## \ No newline at end of file diff --git a/test/mixed_heading_types_atx.md b/test/mixed_heading_types_atx.md new file mode 100644 index 00000000..d94af2a6 --- /dev/null +++ b/test/mixed_heading_types_atx.md @@ -0,0 +1,6 @@ +# Heading + +## Heading 2 {MD003} ## + +Heading 3 {MD003} +----------------- \ No newline at end of file diff --git a/test/mixed_heading_types_atx_closed.md b/test/mixed_heading_types_atx_closed.md new file mode 100644 index 00000000..cc29cf88 --- /dev/null +++ b/test/mixed_heading_types_atx_closed.md @@ -0,0 +1,6 @@ +# Heading 1 # + +## Heading 2 {MD003} + +Heading 3 {MD003} +----------------- \ No newline at end of file diff --git a/test/mixed_heading_types_setext.md b/test/mixed_heading_types_setext.md new file mode 100644 index 00000000..bcf67836 --- /dev/null +++ b/test/mixed_heading_types_setext.md @@ -0,0 +1,6 @@ +Heading 1 +======== + +## Heading 2 {MD003} + +## Heading 3 {MD003} ## \ No newline at end of file diff --git a/test/no_first_line_header.md b/test/no_first_line_header.md deleted file mode 100644 index ef1745b0..00000000 --- a/test/no_first_line_header.md +++ /dev/null @@ -1 +0,0 @@ -This is a file without a top level header {MD041} diff --git a/test/no_first_line_header.json b/test/no_first_line_heading.json similarity index 100% rename from test/no_first_line_header.json rename to test/no_first_line_heading.json diff --git a/test/no_first_line_heading.md b/test/no_first_line_heading.md new file mode 100644 index 00000000..888099bf --- /dev/null +++ b/test/no_first_line_heading.md @@ -0,0 +1 @@ +This is a file without a top level heading {MD041} diff --git a/test/no_first_line_top_level_header.md b/test/no_first_line_top_level_header.md deleted file mode 100644 index e4550602..00000000 --- a/test/no_first_line_top_level_header.md +++ /dev/null @@ -1 +0,0 @@ -## Second level header {MD041} {MD002} diff --git a/test/no_first_line_top_level_header.json b/test/no_first_line_top_level_heading.json similarity index 100% rename from test/no_first_line_top_level_header.json rename to test/no_first_line_top_level_heading.json diff --git a/test/no_first_line_top_level_heading.md b/test/no_first_line_top_level_heading.md new file mode 100644 index 00000000..c4ef94c7 --- /dev/null +++ b/test/no_first_line_top_level_heading.md @@ -0,0 +1 @@ +## Second level heading {MD041} {MD002} diff --git a/test/required-headers-all-optional.json b/test/required-headings-all-optional.json similarity index 62% rename from test/required-headers-all-optional.json rename to test/required-headings-all-optional.json index 59e34a5e..0623eb16 100644 --- a/test/required-headers-all-optional.json +++ b/test/required-headings-all-optional.json @@ -1,6 +1,6 @@ { "default": true, "MD043": { - "headers": [ "*" ] + "headings": [ "*" ] } } diff --git a/test/required-headers-all-optional.md b/test/required-headings-all-optional.md similarity index 100% rename from test/required-headers-all-optional.md rename to test/required-headings-all-optional.md diff --git a/test/required-headers-all-present.json b/test/required-headings-all-present.json similarity index 89% rename from test/required-headers-all-present.json rename to test/required-headings-all-present.json index 778db775..21b11de7 100644 --- a/test/required-headers-all-present.json +++ b/test/required-headings-all-present.json @@ -1,7 +1,7 @@ { "default": true, "MD043": { - "headers": [ + "headings": [ "# One", "## Two", "### Three", diff --git a/test/required-headers-all-present.md b/test/required-headings-all-present.md similarity index 100% rename from test/required-headers-all-present.md rename to test/required-headings-all-present.md diff --git a/test/required-headers-missing-last.json b/test/required-headings-missing-first.json similarity index 84% rename from test/required-headers-missing-last.json rename to test/required-headings-missing-first.json index 24fc53a8..9b762888 100644 --- a/test/required-headers-missing-last.json +++ b/test/required-headings-missing-first.json @@ -1,7 +1,7 @@ { "default": true, "MD043": { - "headers": [ + "headings": [ "# One", "## Two", "### Three" diff --git a/test/required-headers-missing-first.md b/test/required-headings-missing-first.md similarity index 100% rename from test/required-headers-missing-first.md rename to test/required-headings-missing-first.md diff --git a/test/required-headers-missing-first.json b/test/required-headings-missing-last.json similarity index 84% rename from test/required-headers-missing-first.json rename to test/required-headings-missing-last.json index 24fc53a8..9b762888 100644 --- a/test/required-headers-missing-first.json +++ b/test/required-headings-missing-last.json @@ -1,7 +1,7 @@ { "default": true, "MD043": { - "headers": [ + "headings": [ "# One", "## Two", "### Three" diff --git a/test/required-headers-missing-last.md b/test/required-headings-missing-last.md similarity index 100% rename from test/required-headers-missing-last.md rename to test/required-headings-missing-last.md diff --git a/test/required-headers-missing-middle.json b/test/required-headings-missing-middle.json similarity index 86% rename from test/required-headers-missing-middle.json rename to test/required-headings-missing-middle.json index 03c01263..a5e19f5e 100644 --- a/test/required-headers-missing-middle.json +++ b/test/required-headings-missing-middle.json @@ -1,7 +1,7 @@ { "default": true, "MD043": { - "headers": [ + "headings": [ "# One", "## Two", "### Three", diff --git a/test/required-headers-missing-middle.md b/test/required-headings-missing-middle.md similarity index 100% rename from test/required-headers-missing-middle.md rename to test/required-headings-missing-middle.md diff --git a/test/required-headers-none.json b/test/required-headings-none.json similarity index 67% rename from test/required-headers-none.json rename to test/required-headings-none.json index e8da239b..aaaee577 100644 --- a/test/required-headers-none.json +++ b/test/required-headings-none.json @@ -1,6 +1,6 @@ { "default": true, "MD043": { - "headers": [] + "headings": [] } } diff --git a/test/required-headers-none.md b/test/required-headings-none.md similarity index 100% rename from test/required-headers-none.md rename to test/required-headings-none.md diff --git a/test/required-headers-optional-first.json b/test/required-headings-optional-first.json similarity index 83% rename from test/required-headers-optional-first.json rename to test/required-headings-optional-first.json index c76cd421..41d6d818 100644 --- a/test/required-headers-optional-first.json +++ b/test/required-headings-optional-first.json @@ -1,7 +1,7 @@ { "default": true, "MD043": { - "headers": [ + "headings": [ "*", "### Three", "#### Four" diff --git a/test/required-headers-optional-first.md b/test/required-headings-optional-first.md similarity index 100% rename from test/required-headers-optional-first.md rename to test/required-headings-optional-first.md diff --git a/test/required-headers-optional-last.json b/test/required-headings-optional-last.json similarity index 82% rename from test/required-headers-optional-last.json rename to test/required-headings-optional-last.json index c932745a..8ffb4b61 100644 --- a/test/required-headers-optional-last.json +++ b/test/required-headings-optional-last.json @@ -1,7 +1,7 @@ { "default": true, "MD043": { - "headers": [ + "headings": [ "# One", "## Two", "*" diff --git a/test/required-headers-optional-last.md b/test/required-headings-optional-last.md similarity index 100% rename from test/required-headers-optional-last.md rename to test/required-headings-optional-last.md diff --git a/test/required-headers-optional-middle.json b/test/required-headings-optional-middle.json similarity index 87% rename from test/required-headers-optional-middle.json rename to test/required-headings-optional-middle.json index 4b32bc8e..a85025fc 100644 --- a/test/required-headers-optional-middle.json +++ b/test/required-headings-optional-middle.json @@ -1,7 +1,7 @@ { "default": true, "MD043": { - "headers": [ + "headings": [ "# One", "*", "### Three", diff --git a/test/required-headers-optional-middle.md b/test/required-headings-optional-middle.md similarity index 100% rename from test/required-headers-optional-middle.md rename to test/required-headings-optional-middle.md diff --git a/test/required-headers-optional-redundant.json b/test/required-headings-optional-redundant.json similarity index 84% rename from test/required-headers-optional-redundant.json rename to test/required-headings-optional-redundant.json index c1cc3dab..7079b3bc 100644 --- a/test/required-headers-optional-redundant.json +++ b/test/required-headings-optional-redundant.json @@ -1,7 +1,7 @@ { "default": true, "MD043": { - "headers": [ + "headings": [ "# One", "*", "*", diff --git a/test/required-headers-optional-redundant.md b/test/required-headings-optional-redundant.md similarity index 100% rename from test/required-headers-optional-redundant.md rename to test/required-headings-optional-redundant.md diff --git a/test/simple-table.md b/test/simple-table.md index c5d09511..1068bf7e 100644 --- a/test/simple-table.md +++ b/test/simple-table.md @@ -1,4 +1,4 @@ -# Header +# Heading | Head | | ---- |