markdownlint 0.40.0 → 0.41.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/CONTRIBUTING.md +1 -1
  3. package/README.md +13 -25
  4. package/doc/CustomRules.md +1 -1
  5. package/doc/Rules.md +80 -26
  6. package/doc/md001.md +1 -1
  7. package/doc/md011.md +1 -1
  8. package/doc/md022.md +15 -0
  9. package/doc/md025.md +1 -1
  10. package/doc/md026.md +1 -1
  11. package/doc/md028.md +13 -9
  12. package/doc/md029.md +11 -1
  13. package/doc/md034.md +1 -1
  14. package/doc/md035.md +12 -5
  15. package/doc/md041.md +2 -2
  16. package/doc/md042.md +6 -0
  17. package/doc/md045.md +1 -1
  18. package/doc/md060.md +15 -3
  19. package/helpers/README.md +4 -4
  20. package/helpers/helpers.cjs +55 -49
  21. package/helpers/micromark-helpers.cjs +5 -5
  22. package/helpers/package.json +2 -2
  23. package/helpers/shared.cjs +2 -2
  24. package/lib/cache.mjs +1 -0
  25. package/lib/configuration-strict.d.ts +116 -108
  26. package/lib/constants.mjs +2 -2
  27. package/lib/exports.d.mts +1 -0
  28. package/lib/exports.mjs +1 -0
  29. package/lib/markdownit.cjs +8 -7
  30. package/lib/markdownlint.d.mts +56 -41
  31. package/lib/markdownlint.mjs +40 -105
  32. package/lib/md004.mjs +1 -0
  33. package/lib/md005.mjs +1 -1
  34. package/lib/md019-md021.mjs +1 -0
  35. package/lib/md022.mjs +15 -11
  36. package/lib/md024.mjs +1 -1
  37. package/lib/md029.mjs +37 -25
  38. package/lib/md032.mjs +5 -4
  39. package/lib/md036.mjs +1 -0
  40. package/lib/md037.mjs +1 -2
  41. package/lib/md051.mjs +3 -1
  42. package/lib/md060.mjs +47 -8
  43. package/lib/micromark-parse.mjs +21 -5
  44. package/lib/resolve-module.cjs +4 -3
  45. package/lib/resolve-module.d.cts +1 -1
  46. package/package.json +37 -38
  47. package/schema/.markdownlint.jsonc +55 -53
  48. package/schema/.markdownlint.yaml +77 -75
  49. package/schema/markdownlint-config-schema-strict.json +120 -110
  50. package/schema/markdownlint-config-schema.json +120 -110
package/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.41.1
4
+
5
+ - Improve MD029
6
+ - Fix module resolution under webpack
7
+ - Update dependencies
8
+
9
+ ## 0.41.0
10
+
11
+ - Improve MD022/MD028/MD035/MD042/MD051/MD060
12
+ - Remove handling of inline directive syntax (frequent false positives)
13
+ - Remove deprecated `Options.resultVersion` (breaking change)
14
+ - Remove deprecated `LintResults.toString` (breaking change)
15
+ - Remove support for end-of-life Node version 20
16
+ - Update dependencies
17
+
3
18
  ## 0.40.0
4
19
 
5
20
  - Improve MD011/MD013/MD051/MD060
package/CONTRIBUTING.md CHANGED
@@ -84,7 +84,7 @@ Thank you!
84
84
  [closing-keywords]: https://help.github.com/articles/closing-issues-using-keywords/
85
85
  [custom-rules]: doc/CustomRules.md
86
86
  [dependencies]: https://docs.npmjs.com/cli/v11/configuring-npm/package-json#dependencies
87
- [example-com]: https://en.wikipedia.org/wiki/Example.com
87
+ [example-com]: https://wikipedia.org/wiki/Example.com
88
88
  [micromark]: https://www.npmjs.com/package/micromark
89
89
  [new-rule]: https://github.com/DavidAnson/markdownlint/labels/new%20rule
90
90
  [npm-scripts]: https://docs.npmjs.com/misc/scripts
package/README.md CHANGED
@@ -28,16 +28,17 @@ documentation, and test cases came from that project.
28
28
  [CommonMark][commonmark] specification for Markdown. It additionally supports
29
29
  popular [GitHub Flavored Markdown (GFM)][gfm] syntax like autolinks and tables
30
30
  as well as directives, footnotes, and math syntax - all implemented by
31
- [`micromark` extensions][micromark-extensions].
31
+ [`micromark` extensions][micromark-extensions]. (Note that inline directives are
32
+ not supported to avoid confusion due to over-matching.)
32
33
 
33
34
  [commonmark]: https://commonmark.org/
34
35
  [gfm]: https://github.github.com/gfm/
35
- [markdown]: https://en.wikipedia.org/wiki/Markdown
36
+ [markdown]: https://wikipedia.org/wiki/Markdown
36
37
  [markdownlint-ruby]: https://github.com/markdownlint/markdownlint
37
38
  [micromark]: https://github.com/micromark/micromark
38
39
  [micromark-extensions]: https://github.com/micromark/micromark?tab=readme-ov-file#list-of-extensions
39
40
  [nodejs]: https://nodejs.org/
40
- [static-analysis]: https://en.wikipedia.org/wiki/Static_program_analysis
41
+ [static-analysis]: https://wikipedia.org/wiki/Static_program_analysis
41
42
 
42
43
  ### Related
43
44
 
@@ -489,7 +490,7 @@ See [.markdownlint.jsonc](schema/.markdownlint.jsonc) and/or
489
490
  configuration object with all properties set to the default value.
490
491
 
491
492
  Sets of rules (known as a "style") can be stored separately and loaded
492
- as [JSON](https://en.wikipedia.org/wiki/JSON).
493
+ as [JSON](https://wikipedia.org/wiki/JSON).
493
494
 
494
495
  Example of referencing a built-in style from JavaScript:
495
496
 
@@ -604,7 +605,7 @@ Type: `Array` of `String`
604
605
  List of files to lint.
605
606
 
606
607
  Each array element should be a single file (via relative or absolute path);
607
- [globbing](https://en.wikipedia.org/wiki/Glob_%28programming%29) is the
608
+ [globbing](https://wikipedia.org/wiki/Glob_%28programming%29) is the
608
609
  caller's responsibility.
609
610
 
610
611
  Example: `[ "one.md", "dir/two.md" ]`
@@ -626,9 +627,9 @@ The default value:
626
627
  /((^---[^\S\r\n\u2028\u2029]*$[\s\S]+?^---\s*)|(^\+\+\+[^\S\r\n\u2028\u2029]*$[\s\S]+?^(\+\+\+|\.\.\.)\s*)|(^\{[^\S\r\n\u2028\u2029]*$[\s\S]+?^\}\s*))(\r\n|\r|\n|$)/m
627
628
  ```
628
629
 
629
- Ignores [YAML](https://en.wikipedia.org/wiki/YAML),
630
- [TOML](https://en.wikipedia.org/wiki/TOML), and
631
- [JSON](https://en.wikipedia.org/wiki/JSON) front matter such as:
630
+ Ignores [YAML](https://wikipedia.org/wiki/YAML),
631
+ [TOML](https://wikipedia.org/wiki/TOML), and
632
+ [JSON](https://wikipedia.org/wiki/JSON) front matter such as:
632
633
 
633
634
  ```text
634
635
  ---
@@ -715,16 +716,6 @@ By default, properly-formatted inline comments can be used to create exceptions
715
716
  for parts of a document. Setting `noInlineConfig` to `true` ignores all such
716
717
  comments.
717
718
 
718
- ##### ~~options.resultVersion~~
719
-
720
- This property is *deprecated* and should be removed. The default format of the
721
- `result` object remains the same as setting `resultVersion` to `3`. For
722
- continued access to other (previously *deprecated*) formats:
723
-
724
- ```javascript
725
- import { convertToResultVersion0, convertToResultVersion1, convertToResultVersion2 } from "markdownlint/helpers";
726
- ```
727
-
728
719
  ##### options.strings
729
720
 
730
721
  Type: `Object` mapping `String` to `String`
@@ -979,7 +970,7 @@ All of which return an object like:
979
970
  { "lineNumber": 3,
980
971
  "ruleNames": [ "MD010", "no-hard-tabs" ],
981
972
  "ruleDescription": "Hard tabs",
982
- "ruleInformation": "https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md010.md",
973
+ "ruleInformation": "https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md010.md",
983
974
  "errorDetail": "Column: 17",
984
975
  "errorContext": null,
985
976
  "errorRange": [ 17, 1 ],
@@ -988,7 +979,7 @@ All of which return an object like:
988
979
  { "lineNumber": 1,
989
980
  "ruleNames": [ "MD018", "no-missing-space-atx" ],
990
981
  "ruleDescription": "No space after hash on atx style heading",
991
- "ruleInformation": "https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md018.md",
982
+ "ruleInformation": "https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md018.md",
992
983
  "errorDetail": null,
993
984
  "errorContext": "#bad.md",
994
985
  "errorRange": [ 1, 2 ],
@@ -997,7 +988,7 @@ All of which return an object like:
997
988
  { "lineNumber": 3,
998
989
  "ruleNames": [ "MD018", "no-missing-space-atx" ],
999
990
  "ruleDescription": "No space after hash on atx style heading",
1000
- "ruleInformation": "https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md018.md",
991
+ "ruleInformation": "https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md018.md",
1001
992
  "errorDetail": null,
1002
993
  "errorContext": "#This file fails\tsome rules.",
1003
994
  "errorRange": [ 1, 2 ],
@@ -1006,7 +997,7 @@ All of which return an object like:
1006
997
  { "lineNumber": 1,
1007
998
  "ruleNames": [ "MD041", "first-line-heading", "first-line-h1" ],
1008
999
  "ruleDescription": "First line in a file should be a top-level heading",
1009
- "ruleInformation": "https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md041.md",
1000
+ "ruleInformation": "https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md041.md",
1010
1001
  "errorDetail": null,
1011
1002
  "errorContext": "#bad.md",
1012
1003
  "errorRange": null,
@@ -1058,7 +1049,6 @@ following projects or one of the tools in the [Related section](#related):
1058
1049
  - [Garden React Components][garden] ([Search repository][garden-search])
1059
1050
  - [MDN Web Docs][mdn] ([Search repository][mdn-search])
1060
1051
  - [MkDocs][mkdocs] ([Search repository][mkdocs-search])
1061
- - [Mocha][mocha] ([Search repository][mocha-search])
1062
1052
  - [Pi-hole documentation][pi-hole] ([Search repository][pi-hole-search])
1063
1053
  - [Reactable][reactable] ([Search repository][reactable-search])
1064
1054
  - [V8][v8] ([Search repository][v8-search])
@@ -1091,8 +1081,6 @@ For more advanced integration scenarios:
1091
1081
  [mdn-search]: https://github.com/mdn/content/search?q=markdownlint
1092
1082
  [mkdocs]: https://www.mkdocs.org/
1093
1083
  [mkdocs-search]: https://github.com/mkdocs/mkdocs/search?q=markdownlint
1094
- [mocha]: https://mochajs.org/
1095
- [mocha-search]: https://github.com/mochajs/mocha/search?q=markdownlint
1096
1084
  [pi-hole]: https://docs.pi-hole.net
1097
1085
  [pi-hole-search]: https://github.com/pi-hole/docs/search?q=markdownlint
1098
1086
  [reactable]: https://glittershark.github.io/reactable/
@@ -191,4 +191,4 @@ throws an exception.
191
191
  [rule-helpers]: https://www.npmjs.com/package/markdownlint-rule-helpers
192
192
  [options-custom-rules]: ../README.md#optionscustomrules
193
193
  [test-rules]: ../test/rules
194
- [tokens]: ../test/snapshots/markdownlint-test-custom-rules.mjs.md
194
+ [tokens]: ../test/markdownlint-test-custom-rules.mjs.snapshot
package/doc/Rules.md CHANGED
@@ -45,7 +45,7 @@ level at a time:
45
45
  ### Another Heading 3
46
46
  ```
47
47
 
48
- If [YAML](https://en.wikipedia.org/wiki/YAML) front matter is present and
48
+ If [YAML](https://wikipedia.org/wiki/YAML) front matter is present and
49
49
  contains a `title` property (commonly used with blog posts), this rule treats
50
50
  that as a top level heading and will report a violation if the actual first
51
51
  heading is not a level 2 heading. To use a different property name in the
@@ -426,7 +426,7 @@ To fix this, swap the `[]` and `()` around:
426
426
  [Correct link syntax](https://www.example.com/)
427
427
  ```
428
428
 
429
- Note: [Markdown Extra](https://en.wikipedia.org/wiki/Markdown_Extra)-style
429
+ Note: [Markdown Extra](https://wikipedia.org/wiki/Markdown_Extra)-style
430
430
  footnotes do not trigger this rule:
431
431
 
432
432
  ```markdown
@@ -731,6 +731,8 @@ Aliases: `blanks-around-headings`
731
731
 
732
732
  Parameters:
733
733
 
734
+ - `include_front_matter`: Include front matter content (`boolean`, default
735
+ `false`)
734
736
  - `lines_above`: Blank lines above heading (`integer|integer[]`, default `1`)
735
737
  - `lines_below`: Blank lines below heading (`integer|integer[]`, default `1`)
736
738
 
@@ -772,6 +774,19 @@ blank line, [MD012/no-multiple-blanks](md012.md) should also be customized. This
772
774
  rule checks for *at least* as many blank lines as specified; any extra blank
773
775
  lines are ignored.
774
776
 
777
+ By default, [YAML](https://wikipedia.org/wiki/YAML) front matter is ignored, so
778
+ the following document reports no violations:
779
+
780
+ ```markdown
781
+ ---
782
+ title: Title
783
+ ---
784
+ ## Heading
785
+ ```
786
+
787
+ To require the configured number of blank lines between front matter content and
788
+ a document's first heading, set the `include_front_matter` parameter to `true`.
789
+
775
790
  Rationale: Aside from aesthetic reasons, some parsers, including `kramdown`,
776
791
  will not parse headings that don't have a blank line before, and will parse them
777
792
  as regular text.
@@ -898,7 +913,7 @@ lower-level headings (h2, h3, etc.):
898
913
  Note: The `level` parameter can be used to change the top-level (ex: to h2) in
899
914
  cases where an h1 is added externally.
900
915
 
901
- If [YAML](https://en.wikipedia.org/wiki/YAML) front matter is present and
916
+ If [YAML](https://wikipedia.org/wiki/YAML) front matter is present and
902
917
  contains a `title` property (commonly used with blog posts), this rule treats
903
918
  that as a top level heading and will report a violation for any subsequent
904
919
  top-level headings. To use a different property name in the front matter,
@@ -952,7 +967,7 @@ Rationale: Headings are not meant to be full sentences. More information:
952
967
  [Punctuation at the end of headers][end-punctuation].
953
968
 
954
969
  [end-punctuation]: https://cirosantilli.com/markdown-style-guide#punctuation-at-the-end-of-headers
955
- [html-entity-references]: https://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references
970
+ [html-entity-references]: https://wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references
956
971
 
957
972
  <a name="md027"></a>
958
973
 
@@ -998,29 +1013,33 @@ Tags: `blockquote`, `whitespace`
998
1013
  Aliases: `no-blanks-blockquote`
999
1014
 
1000
1015
  This rule is triggered when two blockquote blocks are separated by nothing
1001
- except for a blank line:
1016
+ but a blank line:
1002
1017
 
1003
1018
  ```markdown
1004
1019
  > This is a blockquote
1005
1020
  > which is immediately followed by
1006
1021
 
1007
- > this blockquote. Unfortunately
1008
- > In some parsers, these are treated as the same blockquote.
1022
+ > this blockquote. In some cases,
1023
+ > these may be merged into one blockquote.
1009
1024
  ```
1010
1025
 
1011
- To fix this, ensure that any blockquotes that are right next to each other
1012
- have some text in between:
1026
+ To fix this, ensure that consecutive blockquotes have text (or an HTML comment)
1027
+ in between:
1013
1028
 
1014
1029
  ```markdown
1015
1030
  > This is a blockquote.
1016
1031
 
1017
- And Jimmy also said:
1032
+ This is paragraph text.
1033
+
1034
+ > This is a second blockquote.
1018
1035
 
1019
- > This too is a blockquote.
1036
+ <!-- This is an HTML comment -->
1037
+
1038
+ > This is a third blockquote.
1020
1039
  ```
1021
1040
 
1022
- Alternatively, if they are supposed to be the same quote, then add the
1023
- blockquote symbol at the beginning of the blank line:
1041
+ If they are meant to be a single quote, add the blockquote symbol at the
1042
+ beginning of the blank line:
1024
1043
 
1025
1044
  ```markdown
1026
1045
  > This is a blockquote.
@@ -1091,7 +1110,8 @@ Example invalid list for all styles:
1091
1110
  3. Done.
1092
1111
  ```
1093
1112
 
1094
- This rule supports 0-prefixing ordered list items for uniform indentation:
1113
+ This rule supports 0-prefixing list items for uniform indentation and will
1114
+ preserve that when fixing:
1095
1115
 
1096
1116
  ```markdown
1097
1117
  ...
@@ -1099,7 +1119,16 @@ This rule supports 0-prefixing ordered list items for uniform indentation:
1099
1119
  09. Item
1100
1120
  10. Item
1101
1121
  11. Item
1122
+ ```
1123
+
1124
+ When list items appear to be right-aligned, fixes will maintain that alignment:
1125
+
1126
+ ```markdown
1102
1127
  ...
1128
+ 8. Item
1129
+ 9. Item
1130
+ 10. Item
1131
+ 11. Item
1103
1132
  ```
1104
1133
 
1105
1134
  Note: This rule will report violations for cases like the following where an
@@ -1392,7 +1421,7 @@ For more info, visit <https://www.example.com/> or email <user@example.com>.
1392
1421
 
1393
1422
  If a URL or email address contains non-ASCII characters, it may be not be
1394
1423
  handled as intended even when angle brackets are present. In such cases,
1395
- [percent-encoding](https://en.m.wikipedia.org/wiki/Percent-encoding) can be used
1424
+ [percent-encoding](https://wikipedia.org/wiki/Percent-encoding) can be used
1396
1425
  to comply with the required syntax for URL and email.
1397
1426
 
1398
1427
  Note: To include a bare URL or email without it being converted into a link,
@@ -1437,8 +1466,8 @@ Parameters:
1437
1466
 
1438
1467
  - `style`: Horizontal rule style (`string`, default `consistent`)
1439
1468
 
1440
- This rule is triggered when inconsistent styles of horizontal rules are used
1441
- in the document:
1469
+ This rule is triggered when inconsistent styles of horizontal rules (also known
1470
+ as "thematic breaks") are used in a document:
1442
1471
 
1443
1472
  ```markdown
1444
1473
  ---
@@ -1452,16 +1481,23 @@ in the document:
1452
1481
  ****
1453
1482
  ```
1454
1483
 
1455
- To fix this, use the same horizontal rule everywhere:
1484
+ To fix this, use the same horizontal rule syntax everywhere:
1456
1485
 
1457
1486
  ```markdown
1458
1487
  ---
1459
1488
 
1489
+ ---
1490
+
1460
1491
  ---
1461
1492
  ```
1462
1493
 
1463
- The configured style can ensure all horizontal rules use a specific string or it
1464
- can ensure all horizontal rules match the first horizontal rule (`consistent`).
1494
+ The `style` parameter's default value `consistent` ensures all horizontal rules
1495
+ in a document match the first horizontal rule in that document. To enforce a
1496
+ specific pattern of characters, set the `style` parameter to that string (e.g.,
1497
+ `"* * *"`).
1498
+
1499
+ Note: In order to be recognized as a horizontal rule, a line must contain three
1500
+ or more matching `-`, `_`, or `*` characters with optional space between.
1465
1501
 
1466
1502
  Rationale: Consistent formatting makes it easier to understand a document.
1467
1503
 
@@ -1750,9 +1786,9 @@ in cases where an `h1` is added externally.
1750
1786
  Rationale: The top-level heading often acts as the title of a document. More
1751
1787
  information: <https://cirosantilli.com/markdown-style-guide#top-level-header>.
1752
1788
 
1753
- [HTML]: https://en.wikipedia.org/wiki/HTML
1789
+ [HTML]: https://wikipedia.org/wiki/HTML
1754
1790
  [RegExp]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_expressions
1755
- [YAML]: https://en.wikipedia.org/wiki/YAML
1791
+ [YAML]: https://wikipedia.org/wiki/YAML
1756
1792
 
1757
1793
  <a name="md042"></a>
1758
1794
 
@@ -1778,6 +1814,10 @@ Empty fragments will trigger this rule:
1778
1814
 
1779
1815
  ```markdown
1780
1816
  [an empty fragment](#)
1817
+
1818
+ [an empty link definition][empty]
1819
+
1820
+ [empty]: #
1781
1821
  ```
1782
1822
 
1783
1823
  But non-empty fragments will not:
@@ -1786,6 +1826,8 @@ But non-empty fragments will not:
1786
1826
  [a valid fragment](#fragment)
1787
1827
  ```
1788
1828
 
1829
+ Empty link definitions
1830
+
1789
1831
  Rationale: Empty links do not lead anywhere and therefore don't function as
1790
1832
  links.
1791
1833
 
@@ -1976,7 +2018,7 @@ content of an image for people who may not be able to see it.
1976
2018
  [aria-hidden]: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Attributes/aria-hidden
1977
2019
  [phase2technology]: https://www.phase2technology.com/blog/no-more-excuses
1978
2020
  [w3c]: https://www.w3.org/WAI/alt/
1979
- [wikipedia]: https://en.wikipedia.org/wiki/Alt_attribute
2021
+ [wikipedia]: https://wikipedia.org/wiki/Alt_attribute
1980
2022
 
1981
2023
  <a name="md046"></a>
1982
2024
 
@@ -2698,6 +2740,8 @@ Parameters:
2698
2740
  - `style`: Table column style (`string`, default `any`, values `aligned` /
2699
2741
  `any` / `compact` / `tight`)
2700
2742
 
2743
+ Fixable: Some violations can be fixed by tooling
2744
+
2701
2745
  This rule is triggered when the column separator pipe characters (`|`) of a
2702
2746
  [GitHub Flavored Markdown table][gfm-table-060] are used inconsistently.
2703
2747
 
@@ -2769,6 +2813,16 @@ Style `tight` with `aligned_delimiter`:
2769
2813
  |N|No|
2770
2814
  ```
2771
2815
 
2816
+ Violations for styles `compact` and `tight` are simple/independent and can be
2817
+ fixed automatically. However, fixing even single violations for style `aligned`
2818
+ may require modifying the entire table, and therefore are not automatic:
2819
+
2820
+ ```markdown
2821
+ |Alpha |Delta|
2822
+ |------|-----|
2823
+ |Charlie|Beta|
2824
+ ```
2825
+
2772
2826
  **Note**: This rule does not require leading/trailing pipe characters, so this
2773
2827
  is also a valid table for style `compact`:
2774
2828
 
@@ -2800,10 +2854,10 @@ appear aligned in most editors and monospaced fonts:
2800
2854
 
2801
2855
  Rationale: Consistent formatting makes it easier to understand a document.
2802
2856
 
2803
- [cjk-characters]: https://en.wikipedia.org/wiki/CJK_characters
2804
- [emoji]: https://en.wikipedia.org/wiki/Emoji
2857
+ [cjk-characters]: https://wikipedia.org/wiki/CJK_characters
2858
+ [emoji]: https://wikipedia.org/wiki/Emoji
2805
2859
  [gfm-table-060]: https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/organizing-information-with-tables
2806
- [latin-script]: https://en.wikipedia.org/wiki/Latin_script
2860
+ [latin-script]: https://wikipedia.org/wiki/Latin_script
2807
2861
 
2808
2862
  <!-- markdownlint-configure-file {
2809
2863
  "no-inline-html": {
package/doc/md001.md CHANGED
@@ -37,7 +37,7 @@ level at a time:
37
37
  ### Another Heading 3
38
38
  ```
39
39
 
40
- If [YAML](https://en.wikipedia.org/wiki/YAML) front matter is present and
40
+ If [YAML](https://wikipedia.org/wiki/YAML) front matter is present and
41
41
  contains a `title` property (commonly used with blog posts), this rule treats
42
42
  that as a top level heading and will report a violation if the actual first
43
43
  heading is not a level 2 heading. To use a different property name in the
package/doc/md011.md CHANGED
@@ -20,7 +20,7 @@ To fix this, swap the `[]` and `()` around:
20
20
  [Correct link syntax](https://www.example.com/)
21
21
  ```
22
22
 
23
- Note: [Markdown Extra](https://en.wikipedia.org/wiki/Markdown_Extra)-style
23
+ Note: [Markdown Extra](https://wikipedia.org/wiki/Markdown_Extra)-style
24
24
  footnotes do not trigger this rule:
25
25
 
26
26
  ```markdown
package/doc/md022.md CHANGED
@@ -6,6 +6,8 @@ Aliases: `blanks-around-headings`
6
6
 
7
7
  Parameters:
8
8
 
9
+ - `include_front_matter`: Include front matter content (`boolean`, default
10
+ `false`)
9
11
  - `lines_above`: Blank lines above heading (`integer|integer[]`, default `1`)
10
12
  - `lines_below`: Blank lines below heading (`integer|integer[]`, default `1`)
11
13
 
@@ -47,6 +49,19 @@ blank line, [MD012/no-multiple-blanks](md012.md) should also be customized. This
47
49
  rule checks for *at least* as many blank lines as specified; any extra blank
48
50
  lines are ignored.
49
51
 
52
+ By default, [YAML](https://wikipedia.org/wiki/YAML) front matter is ignored, so
53
+ the following document reports no violations:
54
+
55
+ ```markdown
56
+ ---
57
+ title: Title
58
+ ---
59
+ ## Heading
60
+ ```
61
+
62
+ To require the configured number of blank lines between front matter content and
63
+ a document's first heading, set the `include_front_matter` parameter to `true`.
64
+
50
65
  Rationale: Aside from aesthetic reasons, some parsers, including `kramdown`,
51
66
  will not parse headings that don't have a blank line before, and will parse them
52
67
  as regular text.
package/doc/md025.md CHANGED
@@ -35,7 +35,7 @@ lower-level headings (h2, h3, etc.):
35
35
  Note: The `level` parameter can be used to change the top-level (ex: to h2) in
36
36
  cases where an h1 is added externally.
37
37
 
38
- If [YAML](https://en.wikipedia.org/wiki/YAML) front matter is present and
38
+ If [YAML](https://wikipedia.org/wiki/YAML) front matter is present and
39
39
  contains a `title` property (commonly used with blog posts), this rule treats
40
40
  that as a top level heading and will report a violation for any subsequent
41
41
  top-level headings. To use a different property name in the front matter,
package/doc/md026.md CHANGED
@@ -37,4 +37,4 @@ Rationale: Headings are not meant to be full sentences. More information:
37
37
  [Punctuation at the end of headers][end-punctuation].
38
38
 
39
39
  [end-punctuation]: https://cirosantilli.com/markdown-style-guide#punctuation-at-the-end-of-headers
40
- [html-entity-references]: https://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references
40
+ [html-entity-references]: https://wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references
package/doc/md028.md CHANGED
@@ -5,29 +5,33 @@ Tags: `blockquote`, `whitespace`
5
5
  Aliases: `no-blanks-blockquote`
6
6
 
7
7
  This rule is triggered when two blockquote blocks are separated by nothing
8
- except for a blank line:
8
+ but a blank line:
9
9
 
10
10
  ```markdown
11
11
  > This is a blockquote
12
12
  > which is immediately followed by
13
13
 
14
- > this blockquote. Unfortunately
15
- > In some parsers, these are treated as the same blockquote.
14
+ > this blockquote. In some cases,
15
+ > these may be merged into one blockquote.
16
16
  ```
17
17
 
18
- To fix this, ensure that any blockquotes that are right next to each other
19
- have some text in between:
18
+ To fix this, ensure that consecutive blockquotes have text (or an HTML comment)
19
+ in between:
20
20
 
21
21
  ```markdown
22
22
  > This is a blockquote.
23
23
 
24
- And Jimmy also said:
24
+ This is paragraph text.
25
25
 
26
- > This too is a blockquote.
26
+ > This is a second blockquote.
27
+
28
+ <!-- This is an HTML comment -->
29
+
30
+ > This is a third blockquote.
27
31
  ```
28
32
 
29
- Alternatively, if they are supposed to be the same quote, then add the
30
- blockquote symbol at the beginning of the blank line:
33
+ If they are meant to be a single quote, add the blockquote symbol at the
34
+ beginning of the blank line:
31
35
 
32
36
  ```markdown
33
37
  > This is a blockquote.
package/doc/md029.md CHANGED
@@ -55,7 +55,8 @@ Example invalid list for all styles:
55
55
  3. Done.
56
56
  ```
57
57
 
58
- This rule supports 0-prefixing ordered list items for uniform indentation:
58
+ This rule supports 0-prefixing list items for uniform indentation and will
59
+ preserve that when fixing:
59
60
 
60
61
  ```markdown
61
62
  ...
@@ -63,7 +64,16 @@ This rule supports 0-prefixing ordered list items for uniform indentation:
63
64
  09. Item
64
65
  10. Item
65
66
  11. Item
67
+ ```
68
+
69
+ When list items appear to be right-aligned, fixes will maintain that alignment:
70
+
71
+ ```markdown
66
72
  ...
73
+ 8. Item
74
+ 9. Item
75
+ 10. Item
76
+ 11. Item
67
77
  ```
68
78
 
69
79
  Note: This rule will report violations for cases like the following where an
package/doc/md034.md CHANGED
@@ -21,7 +21,7 @@ For more info, visit <https://www.example.com/> or email <user@example.com>.
21
21
 
22
22
  If a URL or email address contains non-ASCII characters, it may be not be
23
23
  handled as intended even when angle brackets are present. In such cases,
24
- [percent-encoding](https://en.m.wikipedia.org/wiki/Percent-encoding) can be used
24
+ [percent-encoding](https://wikipedia.org/wiki/Percent-encoding) can be used
25
25
  to comply with the required syntax for URL and email.
26
26
 
27
27
  Note: To include a bare URL or email without it being converted into a link,
package/doc/md035.md CHANGED
@@ -8,8 +8,8 @@ Parameters:
8
8
 
9
9
  - `style`: Horizontal rule style (`string`, default `consistent`)
10
10
 
11
- This rule is triggered when inconsistent styles of horizontal rules are used
12
- in the document:
11
+ This rule is triggered when inconsistent styles of horizontal rules (also known
12
+ as "thematic breaks") are used in a document:
13
13
 
14
14
  ```markdown
15
15
  ---
@@ -23,15 +23,22 @@ in the document:
23
23
  ****
24
24
  ```
25
25
 
26
- To fix this, use the same horizontal rule everywhere:
26
+ To fix this, use the same horizontal rule syntax everywhere:
27
27
 
28
28
  ```markdown
29
29
  ---
30
30
 
31
+ ---
32
+
31
33
  ---
32
34
  ```
33
35
 
34
- The configured style can ensure all horizontal rules use a specific string or it
35
- can ensure all horizontal rules match the first horizontal rule (`consistent`).
36
+ The `style` parameter's default value `consistent` ensures all horizontal rules
37
+ in a document match the first horizontal rule in that document. To enforce a
38
+ specific pattern of characters, set the `style` parameter to that string (e.g.,
39
+ `"* * *"`).
40
+
41
+ Note: In order to be recognized as a horizontal rule, a line must contain three
42
+ or more matching `-`, `_`, or `*` characters with optional space between.
36
43
 
37
44
  Rationale: Consistent formatting makes it easier to understand a document.
package/doc/md041.md CHANGED
@@ -59,6 +59,6 @@ in cases where an `h1` is added externally.
59
59
  Rationale: The top-level heading often acts as the title of a document. More
60
60
  information: <https://cirosantilli.com/markdown-style-guide#top-level-header>.
61
61
 
62
- [HTML]: https://en.wikipedia.org/wiki/HTML
62
+ [HTML]: https://wikipedia.org/wiki/HTML
63
63
  [RegExp]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_expressions
64
- [YAML]: https://en.wikipedia.org/wiki/YAML
64
+ [YAML]: https://wikipedia.org/wiki/YAML
package/doc/md042.md CHANGED
@@ -20,6 +20,10 @@ Empty fragments will trigger this rule:
20
20
 
21
21
  ```markdown
22
22
  [an empty fragment](#)
23
+
24
+ [an empty link definition][empty]
25
+
26
+ [empty]: #
23
27
  ```
24
28
 
25
29
  But non-empty fragments will not:
@@ -28,5 +32,7 @@ But non-empty fragments will not:
28
32
  [a valid fragment](#fragment)
29
33
  ```
30
34
 
35
+ Empty link definitions
36
+
31
37
  Rationale: Empty links do not lead anywhere and therefore don't function as
32
38
  links.
package/doc/md045.md CHANGED
@@ -45,4 +45,4 @@ content of an image for people who may not be able to see it.
45
45
  [aria-hidden]: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Attributes/aria-hidden
46
46
  [phase2technology]: https://www.phase2technology.com/blog/no-more-excuses
47
47
  [w3c]: https://www.w3.org/WAI/alt/
48
- [wikipedia]: https://en.wikipedia.org/wiki/Alt_attribute
48
+ [wikipedia]: https://wikipedia.org/wiki/Alt_attribute