From 45424cf45997b819e68c56d17c39f9e0c4c2e93c Mon Sep 17 00:00:00 2001 From: Milos Levacic Date: Mon, 19 Mar 2018 23:39:42 +0100 Subject: [PATCH] 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. --- README.md | 66 ++-- doc/Rules.md | 286 ++++++++-------- lib/md001.js | 6 +- lib/md002.js | 6 +- lib/md003.js | 6 +- lib/md013.js | 15 +- lib/md018.js | 6 +- lib/md019.js | 6 +- lib/md020.js | 8 +- lib/md021.js | 8 +- lib/md022.js | 6 +- lib/md023.js | 12 +- lib/md024.js | 6 +- lib/md025.js | 4 +- lib/md026.js | 4 +- lib/md036.js | 6 +- lib/md041.js | 4 +- lib/md043.js | 16 +- lib/shared.js | 2 +- schema/build-config-schema.js | 23 +- schema/markdownlint-config-schema.json | 218 +++++++++--- test/alternate_top_level_header.md | 3 - ....json => alternate_top_level_heading.json} | 0 test/alternate_top_level_heading.md | 3 + test/atx_closed_header_spacing.md | 17 - ...g.json => atx_closed_heading_spacing.json} | 0 test/atx_closed_heading_spacing.md | 17 + test/atx_header_spacing.md | 5 - ..._spacing.json => atx_heading_spacing.json} | 0 test/atx_heading_spacing.md | 5 + test/break-all-the-rules.json | 6 +- test/break-all-the-rules.md | 22 +- test/byte-order-marker-utf8.md | 2 +- test/code_block_dollar_fence-empty.md | 4 +- test/code_block_dollar_fence.md | 2 +- .../detailed-results-MD001-MD010.results.json | 12 +- test/detailed-results-MD011-MD021.md | 2 +- .../detailed-results-MD011-MD021.results.json | 12 +- .../detailed-results-MD022-MD030.results.json | 16 +- .../detailed-results-MD031-MD040.results.json | 4 +- test/detailed-results-MD041-MD050.json | 4 +- test/detailed-results-MD041-MD050.md | 2 +- .../detailed-results-MD041-MD050.results.json | 10 +- ...detailed-results-front-matter.results.json | 2 +- ... => emphasis-not-heading-in-blockquote.md} | 0 ...ers.md => emphasis_instead_of_headings.md} | 4 +- test/fenced_code_with_nesting.md | 2 +- test/first_header_bad_atx.md | 1 - test/first_header_bad_setext.md | 2 - test/first_header_good_atx.md | 1 - test/first_header_good_setext.md | 2 - test/first_heading_bad_atx.md | 1 + test/first_heading_bad_setext.md | 2 + test/first_heading_good_atx.md | 1 + test/first_heading_good_setext.md | 2 + test/first_line_top_level_header_atx.md | 3 - test/first_line_top_level_header_setext.md | 4 - ... => first_line_top_level_heading_atx.json} | 0 test/first_line_top_level_heading_atx.md | 3 + ... first_line_top_level_heading_setext.json} | 0 test/first_line_top_level_heading_setext.md | 4 + test/front-matter-alt-title-toml.md | 2 +- test/front-matter-empty.md | 2 +- test/front-matter-no-title-h1.md | 2 +- test/front-matter-title-h1.md | 2 +- test/front-matter-title-toml.md | 2 +- test/front-matter-with-dashes.md | 2 +- test/front-matter.md | 4 +- test/header_duplicate_content.md | 11 - test/headers_bad.md | 7 - test/headers_good_setext_with_atx.md | 11 - test/headers_good_setext_with_atx_closed.md | 11 - test/headers_surrounding_space_atx.md | 12 - test/headers_surrounding_space_setext.md | 15 - test/heading_duplicate_content.md | 11 + ...plevel.md => heading_multiple_toplevel.md} | 0 ....md => heading_mutliple_h1_no_toplevel.md} | 0 ...ion.md => heading_trailing_punctuation.md} | 0 ...ding_trailing_punctuation_customized.json} | 0 ...eading_trailing_punctuation_customized.md} | 0 test/headings_bad.md | 7 + test/{headers_good.md => headings_good.md} | 0 ...son => headings_good_setext_with_atx.json} | 0 test/headings_good_setext_with_atx.md | 11 + ...headings_good_setext_with_atx_closed.json} | 0 test/headings_good_setext_with_atx_closed.md | 11 + ...md => headings_good_with_issue_numbers.md} | 0 test/headings_surrounding_space_atx.md | 12 + test/headings_surrounding_space_setext.md | 15 + ...eadings_with_spaces_at_the_beginning.json} | 0 ... headings_with_spaces_at_the_beginning.md} | 6 +- test/hugo-quickstart-example-clean.md | 2 +- test/hugo-quickstart-example-issue.md | 2 +- test/incorrect_header_atx.md | 6 - test/incorrect_header_atx_closed.md | 6 - test/incorrect_header_setext.md | 6 - ...er_atx.json => incorrect_heading_atx.json} | 0 test/incorrect_heading_atx.md | 6 + ...json => incorrect_heading_atx_closed.json} | 0 test/incorrect_heading_atx_closed.md | 6 + ...ext.json => incorrect_heading_setext.json} | 0 test/incorrect_heading_setext.md | 6 + test/inline-disable-enable.md | 2 +- test/inline_html.md | 4 +- test/jekyll_post.md | 4 +- ...s-and-headers.md => lists-and-headings.md} | 8 +- ...ions.json => long-heading-exceptions.json} | 2 +- ...ceptions.md => long-heading-exceptions.md} | 8 +- test/long_lines_code-default.md | 20 +- test/long_lines_code.md | 36 +- test/markdown-extra-footnote.md | 2 +- test/markdownlint-test.js | 312 +++++++++--------- test/md004-list-items-in-blockquote.md | 2 +- ...md033-cannot-read-property-of-undefined.md | 2 +- ...header.md => md036-emphasis-as-heading.md} | 4 +- test/mixed_header_types_atx.md | 6 - test/mixed_header_types_atx_closed.md | 6 - test/mixed_header_types_setext.md | 6 - test/mixed_heading_types_atx.md | 6 + test/mixed_heading_types_atx_closed.md | 6 + test/mixed_heading_types_setext.md | 6 + test/no_first_line_header.md | 1 - ...header.json => no_first_line_heading.json} | 0 test/no_first_line_heading.md | 1 + test/no_first_line_top_level_header.md | 1 - ...n => no_first_line_top_level_heading.json} | 0 test/no_first_line_top_level_heading.md | 1 + ...on => required-headings-all-optional.json} | 2 +- ...l.md => required-headings-all-optional.md} | 0 ...son => required-headings-all-present.json} | 2 +- ...nt.md => required-headings-all-present.md} | 0 ...n => required-headings-missing-first.json} | 2 +- ....md => required-headings-missing-first.md} | 0 ...on => required-headings-missing-last.json} | 2 +- ...t.md => required-headings-missing-last.md} | 0 ... => required-headings-missing-middle.json} | 2 +- ...md => required-headings-missing-middle.md} | 0 ...-none.json => required-headings-none.json} | 2 +- ...ders-none.md => required-headings-none.md} | 0 ... => required-headings-optional-first.json} | 2 +- ...md => required-headings-optional-first.md} | 0 ...n => required-headings-optional-last.json} | 2 +- ....md => required-headings-optional-last.md} | 0 ...=> required-headings-optional-middle.json} | 2 +- ...d => required-headings-optional-middle.md} | 0 ...required-headings-optional-redundant.json} | 2 +- ...> required-headings-optional-redundant.md} | 0 test/simple-table.md | 2 +- 148 files changed, 861 insertions(+), 699 deletions(-) delete mode 100644 test/alternate_top_level_header.md rename test/{alternate_top_level_header.json => alternate_top_level_heading.json} (100%) create mode 100644 test/alternate_top_level_heading.md delete mode 100644 test/atx_closed_header_spacing.md rename test/{atx_closed_header_spacing.json => atx_closed_heading_spacing.json} (100%) create mode 100644 test/atx_closed_heading_spacing.md delete mode 100644 test/atx_header_spacing.md rename test/{atx_header_spacing.json => atx_heading_spacing.json} (100%) create mode 100644 test/atx_heading_spacing.md rename test/{emphasis-not-header-in-blockquote.md => emphasis-not-heading-in-blockquote.md} (100%) rename test/{emphasis_instead_of_headers.md => emphasis_instead_of_headings.md} (93%) delete mode 100644 test/first_header_bad_atx.md delete mode 100644 test/first_header_bad_setext.md delete mode 100644 test/first_header_good_atx.md delete mode 100644 test/first_header_good_setext.md create mode 100644 test/first_heading_bad_atx.md create mode 100644 test/first_heading_bad_setext.md create mode 100644 test/first_heading_good_atx.md create mode 100644 test/first_heading_good_setext.md delete mode 100644 test/first_line_top_level_header_atx.md delete mode 100644 test/first_line_top_level_header_setext.md rename test/{first_line_top_level_header_atx.json => first_line_top_level_heading_atx.json} (100%) create mode 100644 test/first_line_top_level_heading_atx.md rename test/{first_line_top_level_header_setext.json => first_line_top_level_heading_setext.json} (100%) create mode 100644 test/first_line_top_level_heading_setext.md delete mode 100644 test/header_duplicate_content.md delete mode 100644 test/headers_bad.md delete mode 100644 test/headers_good_setext_with_atx.md delete mode 100644 test/headers_good_setext_with_atx_closed.md delete mode 100644 test/headers_surrounding_space_atx.md delete mode 100644 test/headers_surrounding_space_setext.md create mode 100644 test/heading_duplicate_content.md rename test/{header_multiple_toplevel.md => heading_multiple_toplevel.md} (100%) rename test/{header_mutliple_h1_no_toplevel.md => heading_mutliple_h1_no_toplevel.md} (100%) rename test/{header_trailing_punctuation.md => heading_trailing_punctuation.md} (100%) rename test/{header_trailing_punctuation_customized.json => heading_trailing_punctuation_customized.json} (100%) rename test/{header_trailing_punctuation_customized.md => heading_trailing_punctuation_customized.md} (100%) create mode 100644 test/headings_bad.md rename test/{headers_good.md => headings_good.md} (100%) rename test/{headers_good_setext_with_atx.json => headings_good_setext_with_atx.json} (100%) create mode 100644 test/headings_good_setext_with_atx.md rename test/{headers_good_setext_with_atx_closed.json => headings_good_setext_with_atx_closed.json} (100%) create mode 100644 test/headings_good_setext_with_atx_closed.md rename test/{headers_good_with_issue_numbers.md => headings_good_with_issue_numbers.md} (100%) create mode 100644 test/headings_surrounding_space_atx.md create mode 100644 test/headings_surrounding_space_setext.md rename test/{headers_with_spaces_at_the_beginning.json => headings_with_spaces_at_the_beginning.json} (100%) rename test/{headers_with_spaces_at_the_beginning.md => headings_with_spaces_at_the_beginning.md} (74%) delete mode 100644 test/incorrect_header_atx.md delete mode 100644 test/incorrect_header_atx_closed.md delete mode 100644 test/incorrect_header_setext.md rename test/{incorrect_header_atx.json => incorrect_heading_atx.json} (100%) create mode 100644 test/incorrect_heading_atx.md rename test/{incorrect_header_atx_closed.json => incorrect_heading_atx_closed.json} (100%) create mode 100644 test/incorrect_heading_atx_closed.md rename test/{incorrect_header_setext.json => incorrect_heading_setext.json} (100%) create mode 100644 test/incorrect_heading_setext.md rename test/{lists-and-headers.md => lists-and-headings.md} (68%) rename test/{long-header-exceptions.json => long-heading-exceptions.json} (64%) rename test/{long-header-exceptions.md => long-heading-exceptions.md} (57%) rename test/{md036-emphasis-as-header.md => md036-emphasis-as-heading.md} (75%) delete mode 100644 test/mixed_header_types_atx.md delete mode 100644 test/mixed_header_types_atx_closed.md delete mode 100644 test/mixed_header_types_setext.md create mode 100644 test/mixed_heading_types_atx.md create mode 100644 test/mixed_heading_types_atx_closed.md create mode 100644 test/mixed_heading_types_setext.md delete mode 100644 test/no_first_line_header.md rename test/{no_first_line_header.json => no_first_line_heading.json} (100%) create mode 100644 test/no_first_line_heading.md delete mode 100644 test/no_first_line_top_level_header.md rename test/{no_first_line_top_level_header.json => no_first_line_top_level_heading.json} (100%) create mode 100644 test/no_first_line_top_level_heading.md rename test/{required-headers-all-optional.json => required-headings-all-optional.json} (62%) rename test/{required-headers-all-optional.md => required-headings-all-optional.md} (100%) rename test/{required-headers-all-present.json => required-headings-all-present.json} (89%) rename test/{required-headers-all-present.md => required-headings-all-present.md} (100%) rename test/{required-headers-missing-last.json => required-headings-missing-first.json} (84%) rename test/{required-headers-missing-first.md => required-headings-missing-first.md} (100%) rename test/{required-headers-missing-first.json => required-headings-missing-last.json} (84%) rename test/{required-headers-missing-last.md => required-headings-missing-last.md} (100%) rename test/{required-headers-missing-middle.json => required-headings-missing-middle.json} (86%) rename test/{required-headers-missing-middle.md => required-headings-missing-middle.md} (100%) rename test/{required-headers-none.json => required-headings-none.json} (67%) rename test/{required-headers-none.md => required-headings-none.md} (100%) rename test/{required-headers-optional-first.json => required-headings-optional-first.json} (83%) rename test/{required-headers-optional-first.md => required-headings-optional-first.md} (100%) rename test/{required-headers-optional-last.json => required-headings-optional-last.json} (82%) rename test/{required-headers-optional-last.md => required-headings-optional-last.md} (100%) rename test/{required-headers-optional-middle.json => required-headings-optional-middle.json} (87%) rename test/{required-headers-optional-middle.md => required-headings-optional-middle.md} (100%) rename test/{required-headers-optional-redundant.json => required-headings-optional-redundant.json} (84%) rename test/{required-headers-optional-redundant.md => required-headings-optional-redundant.md} (100%) diff --git a/README.md b/README.md index adc75e1b..38f1247f 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 -

Inline HTML header

+

Inline HTML heading

``` To fix this, use 'pure' markdown instead of including raw HTML: ```markdown -# Markdown header +# Markdown heading ``` Rationale: Raw HTML is allowed in markdown, but this rule is included for @@ -1118,16 +1120,16 @@ is allowed. -## 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 ".,;:!?") 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 **My document** @@ -1139,7 +1141,7 @@ _Another section_ 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: ```markdown @@ -1277,27 +1279,27 @@ echo Hello world -## 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 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) -header: +heading: ```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 -# 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 @@ -1343,16 +1345,18 @@ But non-empty fragments will not: -## 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 -headers passed to the rule. It can be used to enforce a standard header +> If a `headings` parameter is not provided, `headers` will be checked instead for backward compatibility. + +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. To require exactly the following structure: @@ -1363,7 +1367,7 @@ To require exactly the following structure: ### Detail ``` -Set the `headers` parameter to: +Set the `headings` parameter to: ```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 # Head @@ -1383,8 +1387,8 @@ To allow optional headers as with the following structure: ### Notes (optional) ``` -Use the special value `"*"` meaning "one or more unspecified headers" and set -the `headers` parameter to: +Use the special value `"*"` meaning "one or more unspecified headings" and set +the `headings` parameter to: ```json [ @@ -1397,10 +1401,10 @@ the `headers` parameter to: ``` 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 -simplicity, a file may use any supported header style. +Note that while the `headings` parameter uses the "## Text" ATX heading style for +simplicity, a file may use any supported heading style. diff --git a/lib/md001.js b/lib/md001.js index c3d346d5..4e244968 100644 --- a/lib/md001.js +++ b/lib/md001.js @@ -5,9 +5,9 @@ var shared = require("./shared"); module.exports = { - "names": [ "MD001", "header-increment" ], - "description": "Header levels should only increment by one level at a time", - "tags": [ "headers" ], + "names": [ "MD001", "heading-increment", "header-increment" ], + "description": "Heading levels should only increment by one level at a time", + "tags": [ "headings", "headers" ], "function": function MD001(params, onError) { var prevLevel = 0; shared.filterTokens(params, "heading_open", function forToken(token) { diff --git a/lib/md002.js b/lib/md002.js index 50a6b6a7..9978b077 100644 --- a/lib/md002.js +++ b/lib/md002.js @@ -5,9 +5,9 @@ var shared = require("./shared"); module.exports = { - "names": [ "MD002", "first-header-h1" ], - "description": "First header should be a top level header", - "tags": [ "headers" ], + "names": [ "MD002", "first-heading-h1", "first-header-h1" ], + "description": "First heading should be a top level heading", + "tags": [ "headings", "headers" ], "function": function MD002(params, onError) { var level = params.config.level || 1; var tag = "h" + level; diff --git a/lib/md003.js b/lib/md003.js index 7fbb1ec5..9fc73459 100644 --- a/lib/md003.js +++ b/lib/md003.js @@ -5,9 +5,9 @@ var shared = require("./shared"); module.exports = { - "names": [ "MD003", "header-style" ], - "description": "Header style", - "tags": [ "headers" ], + "names": [ "MD003", "heading-style", "header-style" ], + "description": "Heading style", + "tags": [ "headings", "headers" ], "function": function MD003(params, onError) { var style = params.config.style || "consistent"; shared.filterTokens(params, "heading_open", function forToken(token) { diff --git a/lib/md013.js b/lib/md013.js index d1152dca..95540798 100644 --- a/lib/md013.js +++ b/lib/md013.js @@ -16,12 +16,15 @@ module.exports = { var includeCodeBlocks = (codeBlocks === undefined) ? true : !!codeBlocks; var tables = params.config.tables; var includeTables = (tables === undefined) ? true : !!tables; - var headers = params.config.headers; - var includeHeaders = (headers === undefined) ? true : !!headers; - var headerLineNumbers = []; - if (!includeHeaders) { + var headings = params.config.headings; + if (headings === undefined) { + headings = params.config.headers; + } + var includeHeadings = (headings === undefined) ? true : !!headings; + var headingLineNumbers = []; + if (!includeHeadings) { shared.forEachHeading(params, function forHeading(heading) { - headerLineNumbers.push(heading.lineNumber); + headingLineNumbers.push(heading.lineNumber); }); } var tokenTypeMap = { @@ -51,7 +54,7 @@ module.exports = { var lineNumber = lineIndex + 1; if ((includeCodeBlocks || !inCode) && (includeTables || !inTable) && - (includeHeaders || (headerLineNumbers.indexOf(lineNumber)) < 0) && + (includeHeadings || (headingLineNumbers.indexOf(lineNumber)) < 0) && (linkOnlyLineNumbers.indexOf(lineNumber) < 0) && longLineRe.test(line) && !labelRe.test(line)) { diff --git a/lib/md018.js b/lib/md018.js index a48a3515..fa0004d7 100644 --- a/lib/md018.js +++ b/lib/md018.js @@ -6,13 +6,13 @@ var shared = require("./shared"); module.exports = { "names": [ "MD018", "no-missing-space-atx" ], - "description": "No space after hash on atx style header", - "tags": [ "headers", "atx", "spaces" ], + "description": "No space after hash on atx style heading", + "tags": [ "headings", "headers", "atx", "spaces" ], "function": function MD018(params, onError) { shared.forEachLine(function forLine(line, lineIndex, inCode) { if (!inCode && /^#+[^#\s]/.test(line) && !/#$/.test(line)) { shared.addErrorContext(onError, lineIndex + 1, line.trim(), null, - null, shared.rangeFromRegExp(line, shared.atxHeaderSpaceRe)); + null, shared.rangeFromRegExp(line, shared.atxHeadingSpaceRe)); } }); } diff --git a/lib/md019.js b/lib/md019.js index 3c6c8137..36adc2a6 100644 --- a/lib/md019.js +++ b/lib/md019.js @@ -6,15 +6,15 @@ var shared = require("./shared"); module.exports = { "names": [ "MD019", "no-multiple-space-atx" ], - "description": "Multiple spaces after hash on atx style header", - "tags": [ "headers", "atx", "spaces" ], + "description": "Multiple spaces after hash on atx style heading", + "tags": [ "headings", "headers", "atx", "spaces" ], "function": function MD019(params, onError) { shared.filterTokens(params, "heading_open", function forToken(token) { if ((shared.headingStyleFor(token) === "atx") && /^#+\s\s/.test(token.line)) { shared.addErrorContext(onError, token.lineNumber, token.line.trim(), null, null, - shared.rangeFromRegExp(token.line, shared.atxHeaderSpaceRe)); + shared.rangeFromRegExp(token.line, shared.atxHeadingSpaceRe)); } }); } diff --git a/lib/md020.js b/lib/md020.js index 22b2842a..12709e6e 100644 --- a/lib/md020.js +++ b/lib/md020.js @@ -4,12 +4,12 @@ var shared = require("./shared"); -var atxClosedHeaderNoSpaceRe = /(?:^#+[^#\s])|(?:[^#\s]#+\s*$)/; +var atxClosedHeadingNoSpaceRe = /(?:^#+[^#\s])|(?:[^#\s]#+\s*$)/; module.exports = { "names": [ "MD020", "no-missing-space-closed-atx" ], - "description": "No space inside hashes on closed atx style header", - "tags": [ "headers", "atx_closed", "spaces" ], + "description": "No space inside hashes on closed atx style heading", + "tags": [ "headings", "headers", "atx_closed", "spaces" ], "function": function MD020(params, onError) { shared.forEachLine(function forLine(line, lineIndex, inCode) { if (!inCode && /^#+[^#]*[^\\]#+$/.test(line)) { @@ -17,7 +17,7 @@ module.exports = { var right = /[^#\s]#+$/.test(line); if (left || right) { shared.addErrorContext(onError, lineIndex + 1, line.trim(), left, - right, shared.rangeFromRegExp(line, atxClosedHeaderNoSpaceRe)); + right, shared.rangeFromRegExp(line, atxClosedHeadingNoSpaceRe)); } } }); diff --git a/lib/md021.js b/lib/md021.js index 49bc607e..9ab93e6f 100644 --- a/lib/md021.js +++ b/lib/md021.js @@ -4,12 +4,12 @@ var shared = require("./shared"); -var atxClosedHeaderSpaceRe = /(?:^#+\s\s+?\S)|(?:\S\s\s+?#+\s*$)/; +var atxClosedHeadingSpaceRe = /(?:^#+\s\s+?\S)|(?:\S\s\s+?#+\s*$)/; module.exports = { "names": [ "MD021", "no-multiple-space-closed-atx" ], - "description": "Multiple spaces inside hashes on closed atx style header", - "tags": [ "headers", "atx_closed", "spaces" ], + "description": "Multiple spaces inside hashes on closed atx style heading", + "tags": [ "headings", "headers", "atx_closed", "spaces" ], "function": function MD021(params, onError) { shared.filterTokens(params, "heading_open", function forToken(token) { if (shared.headingStyleFor(token) === "atx_closed") { @@ -18,7 +18,7 @@ module.exports = { if (left || right) { shared.addErrorContext(onError, token.lineNumber, token.line.trim(), left, right, - shared.rangeFromRegExp(token.line, atxClosedHeaderSpaceRe)); + shared.rangeFromRegExp(token.line, atxClosedHeadingSpaceRe)); } } }); diff --git a/lib/md022.js b/lib/md022.js index bc7a5674..0882ef52 100644 --- a/lib/md022.js +++ b/lib/md022.js @@ -5,9 +5,9 @@ var shared = require("./shared"); module.exports = { - "names": [ "MD022", "blanks-around-headers" ], - "description": "Headers should be surrounded by blank lines", - "tags": [ "headers", "blank_lines" ], + "names": [ "MD022", "blanks-around-headings", "blanks-around-headers" ], + "description": "Headings should be surrounded by blank lines", + "tags": [ "headings", "headers", "blank_lines" ], "function": function MD022(params, onError) { var prevHeadingLineNumber = 0; var prevMaxLineIndex = -1; diff --git a/lib/md023.js b/lib/md023.js index 04f3ab3e..8eeb76e3 100644 --- a/lib/md023.js +++ b/lib/md023.js @@ -4,17 +4,17 @@ var shared = require("./shared"); -var spaceBeforeHeaderRe = /^\s+\S/; +var spaceBeforeHeadingRe = /^\s+\S/; module.exports = { - "names": [ "MD023", "header-start-left" ], - "description": "Headers must start at the beginning of the line", - "tags": [ "headers", "spaces" ], + "names": [ "MD023", "heading-start-left", "header-start-left" ], + "description": "Headings must start at the beginning of the line", + "tags": [ "headings", "headers", "spaces" ], "function": function MD023(params, onError) { 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, - null, shared.rangeFromRegExp(token.line, spaceBeforeHeaderRe)); + null, shared.rangeFromRegExp(token.line, spaceBeforeHeadingRe)); } }); } diff --git a/lib/md024.js b/lib/md024.js index f8aeaab7..ea651dd2 100644 --- a/lib/md024.js +++ b/lib/md024.js @@ -5,9 +5,9 @@ var shared = require("./shared"); module.exports = { - "names": [ "MD024", "no-duplicate-header" ], - "description": "Multiple headers with the same content", - "tags": [ "headers" ], + "names": [ "MD024", "no-duplicate-heading", "no-duplicate-header" ], + "description": "Multiple headings with the same content", + "tags": [ "headings", "headers" ], "function": function MD024(params, onError) { var knownContent = []; shared.forEachHeading(params, function forHeading(heading, content) { diff --git a/lib/md025.js b/lib/md025.js index 751d2c07..2222faa6 100644 --- a/lib/md025.js +++ b/lib/md025.js @@ -6,8 +6,8 @@ var shared = require("./shared"); module.exports = { "names": [ "MD025", "single-h1" ], - "description": "Multiple top level headers in the same document", - "tags": [ "headers" ], + "description": "Multiple top level headings in the same document", + "tags": [ "headings", "headers" ], "function": function MD025(params, onError) { var level = params.config.level || 1; var tag = "h" + level; diff --git a/lib/md026.js b/lib/md026.js index 67e24a61..48f33134 100644 --- a/lib/md026.js +++ b/lib/md026.js @@ -6,8 +6,8 @@ var shared = require("./shared"); module.exports = { "names": [ "MD026", "no-trailing-punctuation" ], - "description": "Trailing punctuation in header", - "tags": [ "headers" ], + "description": "Trailing punctuation in heading", + "tags": [ "headings", "headers" ], "function": function MD026(params, onError) { var punctuation = params.config.punctuation || ".,;:!?"; var trailingPunctuationRe = new RegExp("[" + punctuation + "]$"); diff --git a/lib/md036.js b/lib/md036.js index 0ad29fb3..222caf6a 100644 --- a/lib/md036.js +++ b/lib/md036.js @@ -5,9 +5,9 @@ var shared = require("./shared"); module.exports = { - "names": [ "MD036", "no-emphasis-as-header" ], - "description": "Emphasis used instead of a header", - "tags": [ "headers", "emphasis" ], + "names": [ "MD036", "no-emphasis-as-heading", "no-emphasis-as-header" ], + "description": "Emphasis used instead of a heading", + "tags": [ "headings", "headers", "emphasis" ], "function": function MD036(params, onError) { var punctuation = params.config.punctuation || ".,;:!?"; var re = new RegExp("[" + punctuation + "]$"); diff --git a/lib/md041.js b/lib/md041.js index e6f8848b..0fdb010c 100644 --- a/lib/md041.js +++ b/lib/md041.js @@ -6,8 +6,8 @@ var shared = require("./shared"); module.exports = { "names": [ "MD041", "first-line-h1" ], - "description": "First line in file should be a top level header", - "tags": [ "headers" ], + "description": "First line in file should be a top level heading", + "tags": [ "headings", "headers" ], "function": function MD041(params, onError) { var level = params.config.level || 1; var frontMatterTitle = params.config.front_matter_title; diff --git a/lib/md043.js b/lib/md043.js index ab8438fb..72cb89ba 100644 --- a/lib/md043.js +++ b/lib/md043.js @@ -5,12 +5,12 @@ var shared = require("./shared"); module.exports = { - "names": [ "MD043", "required-headers" ], - "description": "Required header structure", - "tags": [ "headers" ], + "names": [ "MD043", "required-headings", "required-headers" ], + "description": "Required heading structure", + "tags": [ "headings", "headers" ], "function": function MD043(params, onError) { - var requiredHeaders = params.config.headers; - if (requiredHeaders) { + var requiredHeadings = params.config.headings || params.config.headers; + if (requiredHeadings) { var levels = {}; [ 1, 2, 3, 4, 5, 6 ].forEach(function forLevel(level) { levels["h" + level] = "######".substr(-level); @@ -21,7 +21,7 @@ module.exports = { shared.forEachHeading(params, function forHeading(heading, content) { if (!errorCount) { var actual = levels[heading.tag] + " " + content; - var expected = requiredHeaders[i++] || "[None]"; + var expected = requiredHeadings[i++] || "[None]"; if (expected === "*") { optional = true; } 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, - requiredHeaders[i]); + requiredHeadings[i]); } } } diff --git a/lib/shared.js b/lib/shared.js index 23596cd5..55a29df8 100644 --- a/lib/shared.js +++ b/lib/shared.js @@ -14,7 +14,7 @@ var inlineCommentRe = module.exports.inlineCommentRe = inlineCommentRe; // 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.listItemMarkerRe = /^[\s>]*(?:[*+-]|\d+\.)\s+/; diff --git a/schema/build-config-schema.js b/schema/build-config-schema.js index 934db29a..0da0fc06 100644 --- a/schema/build-config-schema.js +++ b/schema/build-config-schema.js @@ -42,7 +42,7 @@ rules.forEach(function forRule(rule) { case "MD025": scheme.properties = { "level": { - "description": "Header level", + "description": "Heading level", "type": "integer", "default": 1 } @@ -51,7 +51,7 @@ rules.forEach(function forRule(rule) { case "MD003": scheme.properties = { "style": { - "description": "Header style", + "description": "Heading style", "type": "string", "enum": [ "consistent", @@ -139,8 +139,13 @@ rules.forEach(function forRule(rule) { "type": "boolean", "default": true }, + "headings": { + "description": "Include headings", + "type": "boolean", + "default": true + }, "headers": { - "description": "Include headers", + "description": "Include headings", "type": "boolean", "default": true } @@ -218,7 +223,7 @@ rules.forEach(function forRule(rule) { case "MD041": scheme.properties = { "level": { - "description": "Header level", + "description": "Heading level", "type": "integer", "default": 1 }, @@ -231,8 +236,16 @@ rules.forEach(function forRule(rule) { break; case "MD043": scheme.properties = { + "headings": { + "description": "List of headings", + "type": "array", + "items": { + "type": "string" + }, + "default": null + }, "headers": { - "description": "List of headers", + "description": "List of headings", "type": "array", "items": { "type": "string" diff --git a/schema/markdownlint-config-schema.json b/schema/markdownlint-config-schema.json index 2c01631c..42213196 100644 --- a/schema/markdownlint-config-schema.json +++ b/schema/markdownlint-config-schema.json @@ -13,17 +13,22 @@ "default": null }, "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", "default": true }, "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", "default": true }, "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": [ "boolean", "object" @@ -31,7 +36,23 @@ "default": true, "properties": { "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", "default": 1 } @@ -39,7 +60,7 @@ "additionalProperties": false }, "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": [ "boolean", "object" @@ -47,7 +68,7 @@ "default": true, "properties": { "level": { - "description": "Header level", + "description": "Heading level", "type": "integer", "default": 1 } @@ -55,7 +76,7 @@ "additionalProperties": false }, "MD003": { - "description": "MD003/header-style - Header style", + "description": "MD003/heading-style/header-style - Heading style", "type": [ "boolean", "object" @@ -63,7 +84,31 @@ "default": true, "properties": { "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", "enum": [ "consistent", @@ -79,7 +124,7 @@ "additionalProperties": false }, "header-style": { - "description": "MD003/header-style - Header style", + "description": "MD003/heading-style/header-style - Heading style", "type": [ "boolean", "object" @@ -87,7 +132,7 @@ "default": true, "properties": { "style": { - "description": "Header style", + "description": "Heading style", "type": "string", "enum": [ "consistent", @@ -339,8 +384,13 @@ "type": "boolean", "default": true }, + "headings": { + "description": "Include headings", + "type": "boolean", + "default": true + }, "headers": { - "description": "Include headers", + "description": "Include headings", "type": "boolean", "default": true } @@ -370,8 +420,13 @@ "type": "boolean", "default": true }, + "headings": { + "description": "Include headings", + "type": "boolean", + "default": true + }, "headers": { - "description": "Include headers", + "description": "Include headings", "type": "boolean", "default": true } @@ -389,77 +444,92 @@ "default": true }, "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", "default": true }, "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", "default": true }, "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", "default": true }, "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", "default": true }, "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", "default": true }, "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", "default": true }, "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", "default": true }, "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", "default": true }, "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", "default": true }, "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", "default": true }, "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", "default": true }, "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", "default": true }, "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", "default": true }, "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", "default": true }, "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": [ "boolean", "object" @@ -467,7 +537,7 @@ "default": true, "properties": { "level": { - "description": "Header level", + "description": "Heading level", "type": "integer", "default": 1 } @@ -475,7 +545,7 @@ "additionalProperties": false }, "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": [ "boolean", "object" @@ -483,7 +553,7 @@ "default": true, "properties": { "level": { - "description": "Header level", + "description": "Heading level", "type": "integer", "default": 1 } @@ -491,7 +561,7 @@ "additionalProperties": false }, "MD026": { - "description": "MD026/no-trailing-punctuation - Trailing punctuation in header", + "description": "MD026/no-trailing-punctuation - Trailing punctuation in heading", "type": [ "boolean", "object" @@ -507,7 +577,7 @@ "additionalProperties": false }, "no-trailing-punctuation": { - "description": "MD026/no-trailing-punctuation - Trailing punctuation in header", + "description": "MD026/no-trailing-punctuation - Trailing punctuation in heading", "type": [ "boolean", "object" @@ -747,7 +817,23 @@ "additionalProperties": false }, "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": [ "boolean", "object" @@ -763,7 +849,7 @@ "additionalProperties": false }, "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": [ "boolean", "object" @@ -819,7 +905,7 @@ "default": true }, "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": [ "boolean", "object" @@ -827,7 +913,7 @@ "default": true, "properties": { "level": { - "description": "Header level", + "description": "Heading level", "type": "integer", "default": 1 }, @@ -840,7 +926,7 @@ "additionalProperties": false }, "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": [ "boolean", "object" @@ -848,7 +934,7 @@ "default": true, "properties": { "level": { - "description": "Header level", + "description": "Heading level", "type": "integer", "default": 1 }, @@ -871,15 +957,50 @@ "default": true }, "MD043": { - "description": "MD043/required-headers - Required header structure", + "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 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", "items": { "type": "string" @@ -890,15 +1011,23 @@ "additionalProperties": false }, "required-headers": { - "description": "MD043/required-headers - Required header structure", + "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 headers", + "description": "List of headings", "type": "array", "items": { "type": "string" @@ -966,6 +1095,11 @@ "type": "boolean", "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": { "description": "headers - MD001, MD002, MD003, MD018, MD019, MD020, MD021, MD022, MD023, MD024, MD025, MD026, MD036, MD041, MD043", "type": "boolean", diff --git a/test/alternate_top_level_header.md b/test/alternate_top_level_header.md deleted file mode 100644 index e3b5f678..00000000 --- a/test/alternate_top_level_header.md +++ /dev/null @@ -1,3 +0,0 @@ -## A level 2 top level header - -## Another one {MD025} diff --git a/test/alternate_top_level_header.json b/test/alternate_top_level_heading.json similarity index 100% rename from test/alternate_top_level_header.json rename to test/alternate_top_level_heading.json diff --git a/test/alternate_top_level_heading.md b/test/alternate_top_level_heading.md new file mode 100644 index 00000000..10d7e970 --- /dev/null +++ b/test/alternate_top_level_heading.md @@ -0,0 +1,3 @@ +## A level 2 top level heading + +## Another one {MD025} diff --git a/test/atx_closed_header_spacing.md b/test/atx_closed_header_spacing.md deleted file mode 100644 index e9a296b3..00000000 --- a/test/atx_closed_header_spacing.md +++ /dev/null @@ -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 \# diff --git a/test/atx_closed_header_spacing.json b/test/atx_closed_heading_spacing.json similarity index 100% rename from test/atx_closed_header_spacing.json rename to test/atx_closed_heading_spacing.json diff --git a/test/atx_closed_heading_spacing.md b/test/atx_closed_heading_spacing.md new file mode 100644 index 00000000..fed3a1c4 --- /dev/null +++ b/test/atx_closed_heading_spacing.md @@ -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 \# diff --git a/test/atx_header_spacing.md b/test/atx_header_spacing.md deleted file mode 100644 index b2c8838a..00000000 --- a/test/atx_header_spacing.md +++ /dev/null @@ -1,5 +0,0 @@ -#Header 1 {MD018} - -## Header 2 {MD019} - -## Header 3 {MD019} \ No newline at end of file diff --git a/test/atx_header_spacing.json b/test/atx_heading_spacing.json similarity index 100% rename from test/atx_header_spacing.json rename to test/atx_heading_spacing.json diff --git a/test/atx_heading_spacing.md b/test/atx_heading_spacing.md new file mode 100644 index 00000000..58443724 --- /dev/null +++ b/test/atx_heading_spacing.md @@ -0,0 +1,5 @@ +#Heading 1 {MD018} + +## Heading 2 {MD019} + +## Heading 3 {MD019} \ No newline at end of file diff --git a/test/break-all-the-rules.json b/test/break-all-the-rules.json index 9f200f6b..ba0e7404 100644 --- a/test/break-all-the-rules.json +++ b/test/break-all-the-rules.json @@ -2,9 +2,9 @@ "default": true, "MD041": true, "MD043": { - "headers": [ - "## Header 1 {MD002} {MD041}", - "#### Header 2 {MD001}", + "headings": [ + "## Heading 1 {MD002} {MD041}", + "#### Heading 2 {MD001}", "# Broken" ] }, diff --git a/test/break-all-the-rules.md b/test/break-all-the-rules.md index f828a333..b19771fc 100644 --- a/test/break-all-the-rules.md +++ b/test/break-all-the-rules.md @@ -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 {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} -#Header 4 {MD018} +#Heading 4 {MD018} -# Header 5 {MD019} +# Heading 5 {MD019} -#Header 6 {MD020} # - # Header 7 {MD021} {MD022} {MD023} {MD003} # +#Heading 6 {MD020} # + # Heading 7 {MD021} {MD022} {MD023} {MD003} # -# Header 8 +# Heading 8 -# Header 8 +# Heading 8 {MD024:34} Note: Can not break MD025 and MD002 in the same file -# Header 9 {MD026}. +# Heading 9 {MD026}. > {MD027} @@ -62,7 +62,7 @@ http://example.com/page {MD034} {MD035:61} -_Section {MD036} Header_ +_Section {MD036} Heading_ Emphasis *with * space {MD037} diff --git a/test/byte-order-marker-utf8.md b/test/byte-order-marker-utf8.md index 51ba1e51..e2764de1 100644 --- a/test/byte-order-marker-utf8.md +++ b/test/byte-order-marker-utf8.md @@ -1,3 +1,3 @@ -# Header +# Heading Text diff --git a/test/code_block_dollar_fence-empty.md b/test/code_block_dollar_fence-empty.md index d94c801b..3f5486f2 100644 --- a/test/code_block_dollar_fence-empty.md +++ b/test/code_block_dollar_fence-empty.md @@ -1,4 +1,4 @@ -# Header +# Heading ```js @@ -10,5 +10,5 @@ ``` ```spaces - + ``` diff --git a/test/code_block_dollar_fence.md b/test/code_block_dollar_fence.md index fae038c1..ff60984b 100644 --- a/test/code_block_dollar_fence.md +++ b/test/code_block_dollar_fence.md @@ -1,4 +1,4 @@ -# header +# heading ```fence $ code diff --git a/test/detailed-results-MD001-MD010.results.json b/test/detailed-results-MD001-MD010.results.json index 1a7fae4c..55cb4488 100644 --- a/test/detailed-results-MD001-MD010.results.json +++ b/test/detailed-results-MD001-MD010.results.json @@ -1,24 +1,24 @@ [ { "lineNumber": 3, - "ruleNames": [ "MD001", "header-increment" ], - "ruleDescription": "Header levels should only increment by one level at a time", + "ruleNames": [ "MD001", "heading-increment", "header-increment" ], + "ruleDescription": "Heading levels should only increment by one level at a time", "errorDetail": "Expected: h3; Actual: h4", "errorContext": null, "errorRange": null }, { "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 }, { "lineNumber": 5, - "ruleNames": [ "MD003", "header-style" ], - "ruleDescription": "Header style", + "ruleNames": [ "MD003", "heading-style", "header-style" ], + "ruleDescription": "Heading style", "errorDetail": "Expected: atx; Actual: atx_closed", "errorContext": null, "errorRange": null diff --git a/test/detailed-results-MD011-MD021.md b/test/detailed-results-MD011-MD021.md index 4978f80c..bc494275 100644 --- a/test/detailed-results-MD011-MD021.md +++ b/test/detailed-results-MD011-MD021.md @@ -1,4 +1,4 @@ -# Top level header +# Top level heading diff --git a/test/detailed-results-MD011-MD021.results.json b/test/detailed-results-MD011-MD021.results.json index 82d92146..aaeedd53 100644 --- a/test/detailed-results-MD011-MD021.results.json +++ b/test/detailed-results-MD011-MD021.results.json @@ -34,7 +34,7 @@ { "lineNumber": 12, "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": "##No space A", "errorRange": [1, 3] @@ -42,7 +42,7 @@ { "lineNumber": 14, "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": "## Multiple spaces B", "errorRange": [1, 5] @@ -50,7 +50,7 @@ { "lineNumber": 16, "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, "errorContext": "##No space C ##", "errorRange": [1, 3] @@ -58,7 +58,7 @@ { "lineNumber": 18, "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, "errorContext": "## No space D##", "errorRange": [13, 3] @@ -66,7 +66,7 @@ { "lineNumber": 20, "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, "errorContext": "## Multiple spaces E ##", "errorRange": [1, 5] @@ -74,7 +74,7 @@ { "lineNumber": 22, "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, "errorContext": "## Multiple spaces F ##", "errorRange": [20, 5] diff --git a/test/detailed-results-MD022-MD030.results.json b/test/detailed-results-MD022-MD030.results.json index fce934e4..78b3dd39 100644 --- a/test/detailed-results-MD022-MD030.results.json +++ b/test/detailed-results-MD022-MD030.results.json @@ -1,24 +1,24 @@ [ { "lineNumber": 1, - "ruleNames": [ "MD022", "blanks-around-headers" ], - "ruleDescription": "Headers should be surrounded by blank lines", + "ruleNames": [ "MD022", "blanks-around-headings", "blanks-around-headers" ], + "ruleDescription": "Headings should be surrounded by blank lines", "errorDetail": null, "errorContext": "# Heading", "errorRange": null }, { "lineNumber": 1, - "ruleNames": [ "MD023", "header-start-left" ], - "ruleDescription": "Headers must start at the beginning of the line", + "ruleNames": [ "MD023", "heading-start-left", "header-start-left" ], + "ruleDescription": "Headings must start at the beginning of the line", "errorDetail": null, "errorContext": " # Heading", "errorRange": [1, 2] }, { "lineNumber": 4, - "ruleNames": [ "MD024", "no-duplicate-header" ], - "ruleDescription": "Multiple headers with the same content", + "ruleNames": [ "MD024", "no-duplicate-heading", "no-duplicate-header" ], + "ruleDescription": "Multiple headings with the same content", "errorDetail": null, "errorContext": "# Heading", "errorRange": null @@ -26,7 +26,7 @@ { "lineNumber": 4, "ruleNames": [ "MD025", "single-h1" ], - "ruleDescription": "Multiple top level headers in the same document", + "ruleDescription": "Multiple top level headings in the same document", "errorDetail": null, "errorContext": "# Heading", "errorRange": null @@ -34,7 +34,7 @@ { "lineNumber": 6, "ruleNames": [ "MD026", "no-trailing-punctuation" ], - "ruleDescription": "Trailing punctuation in header", + "ruleDescription": "Trailing punctuation in heading", "errorDetail": "Punctuation: '.'", "errorContext": null, "errorRange": [19, 1] diff --git a/test/detailed-results-MD031-MD040.results.json b/test/detailed-results-MD031-MD040.results.json index 95907be9..1ff00649 100644 --- a/test/detailed-results-MD031-MD040.results.json +++ b/test/detailed-results-MD031-MD040.results.json @@ -41,8 +41,8 @@ }, { "lineNumber": 13, - "ruleNames": [ "MD036", "no-emphasis-as-header" ], - "ruleDescription": "Emphasis used instead of a header", + "ruleNames": [ "MD036", "no-emphasis-as-heading", "no-emphasis-as-header" ], + "ruleDescription": "Emphasis used instead of a heading", "errorDetail": null, "errorContext": "Emphasis", "errorRange": null diff --git a/test/detailed-results-MD041-MD050.json b/test/detailed-results-MD041-MD050.json index e6ba034d..8e917435 100644 --- a/test/detailed-results-MD041-MD050.json +++ b/test/detailed-results-MD041-MD050.json @@ -2,8 +2,8 @@ "default": true, "MD041": true, "MD043": { - "headers": [ - "# Header" + "headings": [ + "# Heading" ] }, "MD044": { diff --git a/test/detailed-results-MD041-MD050.md b/test/detailed-results-MD041-MD050.md index 31b027b4..8fada572 100644 --- a/test/detailed-results-MD041-MD050.md +++ b/test/detailed-results-MD041-MD050.md @@ -1,4 +1,4 @@ -Not a header +Not a heading An [empty]() link diff --git a/test/detailed-results-MD041-MD050.results.json b/test/detailed-results-MD041-MD050.results.json index 41bbccdc..d2e3098e 100644 --- a/test/detailed-results-MD041-MD050.results.json +++ b/test/detailed-results-MD041-MD050.results.json @@ -2,9 +2,9 @@ { "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": "Not a header", + "errorContext": "Not a heading", "errorRange": null }, { @@ -41,10 +41,10 @@ }, { "lineNumber": 20, - "ruleNames": [ "MD043", "required-headers" ], - "ruleDescription": "Required header structure", + "ruleNames": [ "MD043", "required-headings", "required-headers" ], + "ruleDescription": "Required heading structure", "errorDetail": null, - "errorContext": "# Header", + "errorContext": "# Heading", "errorRange": null }, { diff --git a/test/detailed-results-front-matter.results.json b/test/detailed-results-front-matter.results.json index a37b75c8..78e32db4 100644 --- a/test/detailed-results-front-matter.results.json +++ b/test/detailed-results-front-matter.results.json @@ -10,7 +10,7 @@ { "lineNumber": 4, "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": "Text", "errorRange": null diff --git a/test/emphasis-not-header-in-blockquote.md b/test/emphasis-not-heading-in-blockquote.md similarity index 100% rename from test/emphasis-not-header-in-blockquote.md rename to test/emphasis-not-heading-in-blockquote.md diff --git a/test/emphasis_instead_of_headers.md b/test/emphasis_instead_of_headings.md similarity index 93% rename from test/emphasis_instead_of_headers.md rename to test/emphasis_instead_of_headings.md index 5a65be9c..b75ff669 100644 --- a/test/emphasis_instead_of_headers.md +++ b/test/emphasis_instead_of_headings.md @@ -35,6 +35,6 @@ This is another **normal** paragraph with some text in it. This also should not trigger the rule. **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.** diff --git a/test/fenced_code_with_nesting.md b/test/fenced_code_with_nesting.md index 373399e5..045cce3b 100644 --- a/test/fenced_code_with_nesting.md +++ b/test/fenced_code_with_nesting.md @@ -1,4 +1,4 @@ -# header +# heading text ```fence {MD031} diff --git a/test/first_header_bad_atx.md b/test/first_header_bad_atx.md deleted file mode 100644 index a8e79371..00000000 --- a/test/first_header_bad_atx.md +++ /dev/null @@ -1 +0,0 @@ -## Header {MD002} \ No newline at end of file diff --git a/test/first_header_bad_setext.md b/test/first_header_bad_setext.md deleted file mode 100644 index 207501fb..00000000 --- a/test/first_header_bad_setext.md +++ /dev/null @@ -1,2 +0,0 @@ -Header {MD002} --------------- \ No newline at end of file diff --git a/test/first_header_good_atx.md b/test/first_header_good_atx.md deleted file mode 100644 index 7b163ace..00000000 --- a/test/first_header_good_atx.md +++ /dev/null @@ -1 +0,0 @@ -# Header \ No newline at end of file diff --git a/test/first_header_good_setext.md b/test/first_header_good_setext.md deleted file mode 100644 index e016d0fa..00000000 --- a/test/first_header_good_setext.md +++ /dev/null @@ -1,2 +0,0 @@ -Header -====== \ No newline at end of file diff --git a/test/first_heading_bad_atx.md b/test/first_heading_bad_atx.md new file mode 100644 index 00000000..d28a1c77 --- /dev/null +++ b/test/first_heading_bad_atx.md @@ -0,0 +1 @@ +## Heading {MD002} \ No newline at end of file diff --git a/test/first_heading_bad_setext.md b/test/first_heading_bad_setext.md new file mode 100644 index 00000000..462170c7 --- /dev/null +++ b/test/first_heading_bad_setext.md @@ -0,0 +1,2 @@ +Heading {MD002} +-------------- \ No newline at end of file diff --git a/test/first_heading_good_atx.md b/test/first_heading_good_atx.md new file mode 100644 index 00000000..d9b3ffed --- /dev/null +++ b/test/first_heading_good_atx.md @@ -0,0 +1 @@ +# Heading \ No newline at end of file diff --git a/test/first_heading_good_setext.md b/test/first_heading_good_setext.md new file mode 100644 index 00000000..46ccb11b --- /dev/null +++ b/test/first_heading_good_setext.md @@ -0,0 +1,2 @@ +Heading +======= \ No newline at end of file diff --git a/test/first_line_top_level_header_atx.md b/test/first_line_top_level_header_atx.md deleted file mode 100644 index 7845ec58..00000000 --- a/test/first_line_top_level_header_atx.md +++ /dev/null @@ -1,3 +0,0 @@ -# First line is a top level header - -This shouldn't trigger MD041 diff --git a/test/first_line_top_level_header_setext.md b/test/first_line_top_level_header_setext.md deleted file mode 100644 index f783421d..00000000 --- a/test/first_line_top_level_header_setext.md +++ /dev/null @@ -1,4 +0,0 @@ -First line top level header -=========================== - -This shouldn't trigger MD041 diff --git a/test/first_line_top_level_header_atx.json b/test/first_line_top_level_heading_atx.json similarity index 100% rename from test/first_line_top_level_header_atx.json rename to test/first_line_top_level_heading_atx.json diff --git a/test/first_line_top_level_heading_atx.md b/test/first_line_top_level_heading_atx.md new file mode 100644 index 00000000..1b9ada0b --- /dev/null +++ b/test/first_line_top_level_heading_atx.md @@ -0,0 +1,3 @@ +# First line is a top level heading + +This shouldn't trigger MD041 diff --git a/test/first_line_top_level_header_setext.json b/test/first_line_top_level_heading_setext.json similarity index 100% rename from test/first_line_top_level_header_setext.json rename to test/first_line_top_level_heading_setext.json diff --git a/test/first_line_top_level_heading_setext.md b/test/first_line_top_level_heading_setext.md new file mode 100644 index 00000000..ac81046d --- /dev/null +++ b/test/first_line_top_level_heading_setext.md @@ -0,0 +1,4 @@ +First line top level heading +============================ + +This shouldn't trigger MD041 diff --git a/test/front-matter-alt-title-toml.md b/test/front-matter-alt-title-toml.md index 6bbc8cf5..f7d4d831 100644 --- a/test/front-matter-alt-title-toml.md +++ b/test/front-matter-alt-title-toml.md @@ -1,6 +1,6 @@ +++ date = "2017-01-26T22:17:00+02:00" -alternate = "My document title and header" +alternate = "My document title and heading" +++ Some plain text here. diff --git a/test/front-matter-empty.md b/test/front-matter-empty.md index 2dad3852..be240267 100644 --- a/test/front-matter-empty.md +++ b/test/front-matter-empty.md @@ -1,5 +1,5 @@ --- --- -# Header +# Heading # Another {MD025} diff --git a/test/front-matter-no-title-h1.md b/test/front-matter-no-title-h1.md index 1f17c0ee..35d4a727 100644 --- a/test/front-matter-no-title-h1.md +++ b/test/front-matter-no-title-h1.md @@ -4,6 +4,6 @@ notitle: "Welcome to Jekyll!" date: 2015-11-17 16:16:01 -0600 categories: jekyll update --- -# Top level header +# Top level heading Front matter from [Jekyll documentation](https://jekyllrb.com/docs/posts/#a-typical-post). diff --git a/test/front-matter-title-h1.md b/test/front-matter-title-h1.md index a824ae1d..e077b45f 100644 --- a/test/front-matter-title-h1.md +++ b/test/front-matter-title-h1.md @@ -4,6 +4,6 @@ title: "Welcome to Jekyll!" date: 2015-11-17 16:16:01 -0600 categories: jekyll update --- -# Top level header +# Top level heading Front matter from [Jekyll documentation](https://jekyllrb.com/docs/posts/#a-typical-post). diff --git a/test/front-matter-title-toml.md b/test/front-matter-title-toml.md index ed3eae53..fbb4993f 100644 --- a/test/front-matter-title-toml.md +++ b/test/front-matter-title-toml.md @@ -1,6 +1,6 @@ +++ date = "2017-01-26T22:17:00+02:00" -title = "My document title and header" +title = "My document title and heading" +++ Some plain text here. diff --git a/test/front-matter-with-dashes.md b/test/front-matter-with-dashes.md index 26895e7a..bfd7bc0c 100644 --- a/test/front-matter-with-dashes.md +++ b/test/front-matter-with-dashes.md @@ -3,7 +3,7 @@ layout: post title: Title with --- tags: front matter --- -## Header {MD002} +## Heading {MD002} --- diff --git a/test/front-matter.md b/test/front-matter.md index 80662431..8e893ceb 100644 --- a/test/front-matter.md +++ b/test/front-matter.md @@ -1,6 +1,6 @@ --- front: matter --- -# Header 1 +# Heading 1 -## Header 2 +## Heading 2 diff --git a/test/header_duplicate_content.md b/test/header_duplicate_content.md deleted file mode 100644 index 5ef79d93..00000000 --- a/test/header_duplicate_content.md +++ /dev/null @@ -1,11 +0,0 @@ -# Header 1 - -## Header 2 - -## Header 1 - -### Header 2 - -## Header 3 - -{MD024:5} {MD024:7} \ No newline at end of file diff --git a/test/headers_bad.md b/test/headers_bad.md deleted file mode 100644 index 2bdce536..00000000 --- a/test/headers_bad.md +++ /dev/null @@ -1,7 +0,0 @@ -# Header - -### Header 3 {MD001} - -## Header 2 - -#### Header 4 {MD001} \ No newline at end of file diff --git a/test/headers_good_setext_with_atx.md b/test/headers_good_setext_with_atx.md deleted file mode 100644 index 0ff9aa7d..00000000 --- a/test/headers_good_setext_with_atx.md +++ /dev/null @@ -1,11 +0,0 @@ -Header 1 -======== - -Header 2 --------- - -## Header 2 {MD003} - -### Header 3 - -#### Header 4 {MD003} #### diff --git a/test/headers_good_setext_with_atx_closed.md b/test/headers_good_setext_with_atx_closed.md deleted file mode 100644 index e4b37dab..00000000 --- a/test/headers_good_setext_with_atx_closed.md +++ /dev/null @@ -1,11 +0,0 @@ -Header 1 -======== - -Header 2 --------- - -## Header 2 {MD003} ## - -### Header 3 ### - -#### Header 4 {MD003} diff --git a/test/headers_surrounding_space_atx.md b/test/headers_surrounding_space_atx.md deleted file mode 100644 index da18557d..00000000 --- a/test/headers_surrounding_space_atx.md +++ /dev/null @@ -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. diff --git a/test/headers_surrounding_space_setext.md b/test/headers_surrounding_space_setext.md deleted file mode 100644 index 65f4c45e..00000000 --- a/test/headers_surrounding_space_setext.md +++ /dev/null @@ -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 --------- \ No newline at end of file diff --git a/test/heading_duplicate_content.md b/test/heading_duplicate_content.md new file mode 100644 index 00000000..662aaa6f --- /dev/null +++ b/test/heading_duplicate_content.md @@ -0,0 +1,11 @@ +# Heading 1 + +## Heading 2 + +## Heading 1 + +### Heading 2 + +## Heading 3 + +{MD024:5} {MD024:7} \ No newline at end of file diff --git a/test/header_multiple_toplevel.md b/test/heading_multiple_toplevel.md similarity index 100% rename from test/header_multiple_toplevel.md rename to test/heading_multiple_toplevel.md diff --git a/test/header_mutliple_h1_no_toplevel.md b/test/heading_mutliple_h1_no_toplevel.md similarity index 100% rename from test/header_mutliple_h1_no_toplevel.md rename to test/heading_mutliple_h1_no_toplevel.md diff --git a/test/header_trailing_punctuation.md b/test/heading_trailing_punctuation.md similarity index 100% rename from test/header_trailing_punctuation.md rename to test/heading_trailing_punctuation.md diff --git a/test/header_trailing_punctuation_customized.json b/test/heading_trailing_punctuation_customized.json similarity index 100% rename from test/header_trailing_punctuation_customized.json rename to test/heading_trailing_punctuation_customized.json diff --git a/test/header_trailing_punctuation_customized.md b/test/heading_trailing_punctuation_customized.md similarity index 100% rename from test/header_trailing_punctuation_customized.md rename to test/heading_trailing_punctuation_customized.md diff --git a/test/headings_bad.md b/test/headings_bad.md new file mode 100644 index 00000000..1fa4b013 --- /dev/null +++ b/test/headings_bad.md @@ -0,0 +1,7 @@ +# Heading + +### Heading 3 {MD001} + +## Heading 2 + +#### Heading 4 {MD001} \ No newline at end of file diff --git a/test/headers_good.md b/test/headings_good.md similarity index 100% rename from test/headers_good.md rename to test/headings_good.md diff --git a/test/headers_good_setext_with_atx.json b/test/headings_good_setext_with_atx.json similarity index 100% rename from test/headers_good_setext_with_atx.json rename to test/headings_good_setext_with_atx.json diff --git a/test/headings_good_setext_with_atx.md b/test/headings_good_setext_with_atx.md new file mode 100644 index 00000000..9d77783e --- /dev/null +++ b/test/headings_good_setext_with_atx.md @@ -0,0 +1,11 @@ +Heading 1 +========= + +Heading 2 +--------- + +## Heading 2 {MD003} + +### Heading 3 + +#### Heading 4 {MD003} #### diff --git a/test/headers_good_setext_with_atx_closed.json b/test/headings_good_setext_with_atx_closed.json similarity index 100% rename from test/headers_good_setext_with_atx_closed.json rename to test/headings_good_setext_with_atx_closed.json diff --git a/test/headings_good_setext_with_atx_closed.md b/test/headings_good_setext_with_atx_closed.md new file mode 100644 index 00000000..c1b16b73 --- /dev/null +++ b/test/headings_good_setext_with_atx_closed.md @@ -0,0 +1,11 @@ +Heading 1 +========= + +Heading 2 +--------- + +## Heading 2 {MD003} ## + +### Heading 3 ### + +#### Heading 4 {MD003} diff --git a/test/headers_good_with_issue_numbers.md b/test/headings_good_with_issue_numbers.md similarity index 100% rename from test/headers_good_with_issue_numbers.md rename to test/headings_good_with_issue_numbers.md diff --git a/test/headings_surrounding_space_atx.md b/test/headings_surrounding_space_atx.md new file mode 100644 index 00000000..5279c51b --- /dev/null +++ b/test/headings_surrounding_space_atx.md @@ -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. diff --git a/test/headings_surrounding_space_setext.md b/test/headings_surrounding_space_setext.md new file mode 100644 index 00000000..8aabebc6 --- /dev/null +++ b/test/headings_surrounding_space_setext.md @@ -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 +--------- \ No newline at end of file diff --git a/test/headers_with_spaces_at_the_beginning.json b/test/headings_with_spaces_at_the_beginning.json similarity index 100% rename from test/headers_with_spaces_at_the_beginning.json rename to test/headings_with_spaces_at_the_beginning.json diff --git a/test/headers_with_spaces_at_the_beginning.md b/test/headings_with_spaces_at_the_beginning.md similarity index 74% rename from test/headers_with_spaces_at_the_beginning.md rename to test/headings_with_spaces_at_the_beginning.md index 10aacf85..4ab2808b 100644 --- a/test/headers_with_spaces_at_the_beginning.md +++ b/test/headings_with_spaces_at_the_beginning.md @@ -1,6 +1,6 @@ Some text - # Header 1 {MD023} + # Heading 1 {MD023} Setext style fully indented {MD023} =================================== @@ -16,5 +16,5 @@ Some text ``` * This is another case where MD023 shouldn't be triggered - # Test {MD023} Valid header for CommonMark (see section 5.2) - # Test {MD023} Also valid header for CommonMark + # Test {MD023} Valid heading for CommonMark (see section 5.2) + # Test {MD023} Also valid heading for CommonMark diff --git a/test/hugo-quickstart-example-clean.md b/test/hugo-quickstart-example-clean.md index e0b19bcb..f30b38e9 100644 --- a/test/hugo-quickstart-example-clean.md +++ b/test/hugo-quickstart-example-clean.md @@ -4,4 +4,4 @@ draft = true title = "Good to Great Book Review" +++ -# Header 1 +# Heading 1 diff --git a/test/hugo-quickstart-example-issue.md b/test/hugo-quickstart-example-issue.md index 601cf4f8..1bfb15ba 100644 --- a/test/hugo-quickstart-example-issue.md +++ b/test/hugo-quickstart-example-issue.md @@ -5,4 +5,4 @@ title = "Good to Great Book Review" +++ -# Header 1 {MD041} +# Heading 1 {MD041} diff --git a/test/incorrect_header_atx.md b/test/incorrect_header_atx.md deleted file mode 100644 index 024a90e0..00000000 --- a/test/incorrect_header_atx.md +++ /dev/null @@ -1,6 +0,0 @@ -# Header 1 {MD003} # - -## Header 2 - -Header 3 {MD003} ----------------- diff --git a/test/incorrect_header_atx_closed.md b/test/incorrect_header_atx_closed.md deleted file mode 100644 index 154fd35e..00000000 --- a/test/incorrect_header_atx_closed.md +++ /dev/null @@ -1,6 +0,0 @@ -# Header 1 # - -## Header 2 {MD003} - -Header 3 {MD003} ----------------- diff --git a/test/incorrect_header_setext.md b/test/incorrect_header_setext.md deleted file mode 100644 index f34ef6c9..00000000 --- a/test/incorrect_header_setext.md +++ /dev/null @@ -1,6 +0,0 @@ -# Header 1 {MD003} # - -## Header 2 {MD003} - -Header 3 --------- diff --git a/test/incorrect_header_atx.json b/test/incorrect_heading_atx.json similarity index 100% rename from test/incorrect_header_atx.json rename to test/incorrect_heading_atx.json diff --git a/test/incorrect_heading_atx.md b/test/incorrect_heading_atx.md new file mode 100644 index 00000000..e701fca0 --- /dev/null +++ b/test/incorrect_heading_atx.md @@ -0,0 +1,6 @@ +# Heading 1 {MD003} # + +## Heading 2 + +Heading 3 {MD003} +----------------- diff --git a/test/incorrect_header_atx_closed.json b/test/incorrect_heading_atx_closed.json similarity index 100% rename from test/incorrect_header_atx_closed.json rename to test/incorrect_heading_atx_closed.json diff --git a/test/incorrect_heading_atx_closed.md b/test/incorrect_heading_atx_closed.md new file mode 100644 index 00000000..e786dd65 --- /dev/null +++ b/test/incorrect_heading_atx_closed.md @@ -0,0 +1,6 @@ +# Heading 1 # + +## Heading 2 {MD003} + +Heading 3 {MD003} +----------------- diff --git a/test/incorrect_header_setext.json b/test/incorrect_heading_setext.json similarity index 100% rename from test/incorrect_header_setext.json rename to test/incorrect_heading_setext.json diff --git a/test/incorrect_heading_setext.md b/test/incorrect_heading_setext.md new file mode 100644 index 00000000..9107a239 --- /dev/null +++ b/test/incorrect_heading_setext.md @@ -0,0 +1,6 @@ +# Heading 1 {MD003} # + +## Heading 2 {MD003} + +Heading 3 +--------- diff --git a/test/inline-disable-enable.md b/test/inline-disable-enable.md index 7b6ef7b8..50a13da6 100644 --- a/test/inline-disable-enable.md +++ b/test/inline-disable-enable.md @@ -1,4 +1,4 @@ -# Header +# Heading hard tab {MD010} / space * in * emphasis {MD037} / space ` in ` code {MD038} diff --git a/test/inline_html.md b/test/inline_html.md index 5759f00f..decd1d26 100644 --- a/test/inline_html.md +++ b/test/inline_html.md @@ -1,6 +1,6 @@ -# Regular header +# Regular heading -

Inline HTML Header {MD033}

+

Inline HTML Heading {MD033}

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 | | ---- |