markdownlint 0.40.0 → 0.41.0
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.
- package/CHANGELOG.md +9 -0
- package/CONTRIBUTING.md +1 -1
- package/README.md +13 -25
- package/doc/CustomRules.md +1 -1
- package/doc/Rules.md +69 -25
- package/doc/md001.md +1 -1
- package/doc/md011.md +1 -1
- package/doc/md022.md +15 -0
- package/doc/md025.md +1 -1
- package/doc/md026.md +1 -1
- package/doc/md028.md +13 -9
- package/doc/md034.md +1 -1
- package/doc/md035.md +12 -5
- package/doc/md041.md +2 -2
- package/doc/md042.md +6 -0
- package/doc/md045.md +1 -1
- package/doc/md060.md +15 -3
- package/helpers/README.md +4 -4
- package/helpers/helpers.cjs +45 -46
- package/helpers/micromark-helpers.cjs +4 -3
- package/helpers/package.json +2 -2
- package/helpers/shared.cjs +1 -1
- package/lib/configuration-strict.d.ts +116 -108
- package/lib/constants.mjs +2 -2
- package/lib/exports.d.mts +1 -0
- package/lib/exports.mjs +1 -0
- package/lib/markdownit.cjs +8 -7
- package/lib/markdownlint.d.mts +56 -41
- package/lib/markdownlint.mjs +35 -103
- package/lib/md022.mjs +14 -11
- package/lib/md029.mjs +3 -3
- package/lib/md036.mjs +1 -0
- package/lib/md051.mjs +2 -1
- package/lib/md060.mjs +47 -8
- package/lib/micromark-parse.mjs +19 -4
- package/lib/resolve-module.cjs +3 -3
- package/lib/resolve-module.d.cts +1 -1
- package/package.json +35 -38
- package/schema/.markdownlint.jsonc +55 -53
- package/schema/.markdownlint.yaml +55 -53
- package/schema/markdownlint-config-schema-strict.json +120 -110
- package/schema/markdownlint-config-schema.json +120 -110
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.41.0
|
|
4
|
+
|
|
5
|
+
- Improve MD022/MD028/MD035/MD042/MD051/MD060
|
|
6
|
+
- Remove handling of inline directive syntax (frequent false positives)
|
|
7
|
+
- Remove deprecated `Options.resultVersion` (breaking change)
|
|
8
|
+
- Remove deprecated `LintResults.toString` (breaking change)
|
|
9
|
+
- Remove support for end-of-life Node version 20
|
|
10
|
+
- Update dependencies
|
|
11
|
+
|
|
3
12
|
## 0.40.0
|
|
4
13
|
|
|
5
14
|
- 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://
|
|
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://
|
|
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://
|
|
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://
|
|
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://
|
|
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://
|
|
630
|
-
[TOML](https://
|
|
631
|
-
[JSON](https://
|
|
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.
|
|
973
|
+
"ruleInformation": "https://github.com/DavidAnson/markdownlint/blob/v0.41.0/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.
|
|
982
|
+
"ruleInformation": "https://github.com/DavidAnson/markdownlint/blob/v0.41.0/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.
|
|
991
|
+
"ruleInformation": "https://github.com/DavidAnson/markdownlint/blob/v0.41.0/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.
|
|
1000
|
+
"ruleInformation": "https://github.com/DavidAnson/markdownlint/blob/v0.41.0/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/
|
package/doc/CustomRules.md
CHANGED
|
@@ -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/
|
|
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://
|
|
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://
|
|
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://
|
|
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://
|
|
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
|
-
|
|
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.
|
|
1008
|
-
>
|
|
1022
|
+
> this blockquote. In some cases,
|
|
1023
|
+
> these may be merged into one blockquote.
|
|
1009
1024
|
```
|
|
1010
1025
|
|
|
1011
|
-
To fix this, ensure that
|
|
1012
|
-
|
|
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
|
-
|
|
1032
|
+
This is paragraph text.
|
|
1018
1033
|
|
|
1019
|
-
> This
|
|
1034
|
+
> This is a second blockquote.
|
|
1035
|
+
|
|
1036
|
+
<!-- This is an HTML comment -->
|
|
1037
|
+
|
|
1038
|
+
> This is a third blockquote.
|
|
1020
1039
|
```
|
|
1021
1040
|
|
|
1022
|
-
|
|
1023
|
-
|
|
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.
|
|
@@ -1392,7 +1411,7 @@ For more info, visit <https://www.example.com/> or email <user@example.com>.
|
|
|
1392
1411
|
|
|
1393
1412
|
If a URL or email address contains non-ASCII characters, it may be not be
|
|
1394
1413
|
handled as intended even when angle brackets are present. In such cases,
|
|
1395
|
-
[percent-encoding](https://
|
|
1414
|
+
[percent-encoding](https://wikipedia.org/wiki/Percent-encoding) can be used
|
|
1396
1415
|
to comply with the required syntax for URL and email.
|
|
1397
1416
|
|
|
1398
1417
|
Note: To include a bare URL or email without it being converted into a link,
|
|
@@ -1437,8 +1456,8 @@ Parameters:
|
|
|
1437
1456
|
|
|
1438
1457
|
- `style`: Horizontal rule style (`string`, default `consistent`)
|
|
1439
1458
|
|
|
1440
|
-
This rule is triggered when inconsistent styles of horizontal rules
|
|
1441
|
-
in
|
|
1459
|
+
This rule is triggered when inconsistent styles of horizontal rules (also known
|
|
1460
|
+
as "thematic breaks") are used in a document:
|
|
1442
1461
|
|
|
1443
1462
|
```markdown
|
|
1444
1463
|
---
|
|
@@ -1452,16 +1471,23 @@ in the document:
|
|
|
1452
1471
|
****
|
|
1453
1472
|
```
|
|
1454
1473
|
|
|
1455
|
-
To fix this, use the same horizontal rule everywhere:
|
|
1474
|
+
To fix this, use the same horizontal rule syntax everywhere:
|
|
1456
1475
|
|
|
1457
1476
|
```markdown
|
|
1458
1477
|
---
|
|
1459
1478
|
|
|
1479
|
+
---
|
|
1480
|
+
|
|
1460
1481
|
---
|
|
1461
1482
|
```
|
|
1462
1483
|
|
|
1463
|
-
The
|
|
1464
|
-
|
|
1484
|
+
The `style` parameter's default value `consistent` ensures all horizontal rules
|
|
1485
|
+
in a document match the first horizontal rule in that document. To enforce a
|
|
1486
|
+
specific pattern of characters, set the `style` parameter to that string (e.g.,
|
|
1487
|
+
`"* * *"`).
|
|
1488
|
+
|
|
1489
|
+
Note: In order to be recognized as a horizontal rule, a line must contain three
|
|
1490
|
+
or more matching `-`, `_`, or `*` characters with optional space between.
|
|
1465
1491
|
|
|
1466
1492
|
Rationale: Consistent formatting makes it easier to understand a document.
|
|
1467
1493
|
|
|
@@ -1750,9 +1776,9 @@ in cases where an `h1` is added externally.
|
|
|
1750
1776
|
Rationale: The top-level heading often acts as the title of a document. More
|
|
1751
1777
|
information: <https://cirosantilli.com/markdown-style-guide#top-level-header>.
|
|
1752
1778
|
|
|
1753
|
-
[HTML]: https://
|
|
1779
|
+
[HTML]: https://wikipedia.org/wiki/HTML
|
|
1754
1780
|
[RegExp]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_expressions
|
|
1755
|
-
[YAML]: https://
|
|
1781
|
+
[YAML]: https://wikipedia.org/wiki/YAML
|
|
1756
1782
|
|
|
1757
1783
|
<a name="md042"></a>
|
|
1758
1784
|
|
|
@@ -1778,6 +1804,10 @@ Empty fragments will trigger this rule:
|
|
|
1778
1804
|
|
|
1779
1805
|
```markdown
|
|
1780
1806
|
[an empty fragment](#)
|
|
1807
|
+
|
|
1808
|
+
[an empty link definition][empty]
|
|
1809
|
+
|
|
1810
|
+
[empty]: #
|
|
1781
1811
|
```
|
|
1782
1812
|
|
|
1783
1813
|
But non-empty fragments will not:
|
|
@@ -1786,6 +1816,8 @@ But non-empty fragments will not:
|
|
|
1786
1816
|
[a valid fragment](#fragment)
|
|
1787
1817
|
```
|
|
1788
1818
|
|
|
1819
|
+
Empty link definitions
|
|
1820
|
+
|
|
1789
1821
|
Rationale: Empty links do not lead anywhere and therefore don't function as
|
|
1790
1822
|
links.
|
|
1791
1823
|
|
|
@@ -1976,7 +2008,7 @@ content of an image for people who may not be able to see it.
|
|
|
1976
2008
|
[aria-hidden]: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Attributes/aria-hidden
|
|
1977
2009
|
[phase2technology]: https://www.phase2technology.com/blog/no-more-excuses
|
|
1978
2010
|
[w3c]: https://www.w3.org/WAI/alt/
|
|
1979
|
-
[wikipedia]: https://
|
|
2011
|
+
[wikipedia]: https://wikipedia.org/wiki/Alt_attribute
|
|
1980
2012
|
|
|
1981
2013
|
<a name="md046"></a>
|
|
1982
2014
|
|
|
@@ -2698,6 +2730,8 @@ Parameters:
|
|
|
2698
2730
|
- `style`: Table column style (`string`, default `any`, values `aligned` /
|
|
2699
2731
|
`any` / `compact` / `tight`)
|
|
2700
2732
|
|
|
2733
|
+
Fixable: Some violations can be fixed by tooling
|
|
2734
|
+
|
|
2701
2735
|
This rule is triggered when the column separator pipe characters (`|`) of a
|
|
2702
2736
|
[GitHub Flavored Markdown table][gfm-table-060] are used inconsistently.
|
|
2703
2737
|
|
|
@@ -2769,6 +2803,16 @@ Style `tight` with `aligned_delimiter`:
|
|
|
2769
2803
|
|N|No|
|
|
2770
2804
|
```
|
|
2771
2805
|
|
|
2806
|
+
Violations for styles `compact` and `tight` are simple/independent and can be
|
|
2807
|
+
fixed automatically. However, fixing even single violations for style `aligned`
|
|
2808
|
+
may require modifying the entire table, and therefore are not automatic:
|
|
2809
|
+
|
|
2810
|
+
```markdown
|
|
2811
|
+
|Alpha |Delta|
|
|
2812
|
+
|------|-----|
|
|
2813
|
+
|Charlie|Beta|
|
|
2814
|
+
```
|
|
2815
|
+
|
|
2772
2816
|
**Note**: This rule does not require leading/trailing pipe characters, so this
|
|
2773
2817
|
is also a valid table for style `compact`:
|
|
2774
2818
|
|
|
@@ -2800,10 +2844,10 @@ appear aligned in most editors and monospaced fonts:
|
|
|
2800
2844
|
|
|
2801
2845
|
Rationale: Consistent formatting makes it easier to understand a document.
|
|
2802
2846
|
|
|
2803
|
-
[cjk-characters]: https://
|
|
2804
|
-
[emoji]: https://
|
|
2847
|
+
[cjk-characters]: https://wikipedia.org/wiki/CJK_characters
|
|
2848
|
+
[emoji]: https://wikipedia.org/wiki/Emoji
|
|
2805
2849
|
[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://
|
|
2850
|
+
[latin-script]: https://wikipedia.org/wiki/Latin_script
|
|
2807
2851
|
|
|
2808
2852
|
<!-- markdownlint-configure-file {
|
|
2809
2853
|
"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://
|
|
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://
|
|
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://
|
|
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://
|
|
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
|
-
|
|
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.
|
|
15
|
-
>
|
|
14
|
+
> this blockquote. In some cases,
|
|
15
|
+
> these may be merged into one blockquote.
|
|
16
16
|
```
|
|
17
17
|
|
|
18
|
-
To fix this, ensure that
|
|
19
|
-
|
|
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
|
-
|
|
24
|
+
This is paragraph text.
|
|
25
25
|
|
|
26
|
-
> This
|
|
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
|
-
|
|
30
|
-
|
|
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/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://
|
|
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
|
|
12
|
-
in
|
|
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
|
|
35
|
-
|
|
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://
|
|
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://
|
|
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://
|
|
48
|
+
[wikipedia]: https://wikipedia.org/wiki/Alt_attribute
|
package/doc/md060.md
CHANGED
|
@@ -10,6 +10,8 @@ Parameters:
|
|
|
10
10
|
- `style`: Table column style (`string`, default `any`, values `aligned` /
|
|
11
11
|
`any` / `compact` / `tight`)
|
|
12
12
|
|
|
13
|
+
Fixable: Some violations can be fixed by tooling
|
|
14
|
+
|
|
13
15
|
This rule is triggered when the column separator pipe characters (`|`) of a
|
|
14
16
|
[GitHub Flavored Markdown table][gfm-table-060] are used inconsistently.
|
|
15
17
|
|
|
@@ -81,6 +83,16 @@ Style `tight` with `aligned_delimiter`:
|
|
|
81
83
|
|N|No|
|
|
82
84
|
```
|
|
83
85
|
|
|
86
|
+
Violations for styles `compact` and `tight` are simple/independent and can be
|
|
87
|
+
fixed automatically. However, fixing even single violations for style `aligned`
|
|
88
|
+
may require modifying the entire table, and therefore are not automatic:
|
|
89
|
+
|
|
90
|
+
```markdown
|
|
91
|
+
|Alpha |Delta|
|
|
92
|
+
|------|-----|
|
|
93
|
+
|Charlie|Beta|
|
|
94
|
+
```
|
|
95
|
+
|
|
84
96
|
**Note**: This rule does not require leading/trailing pipe characters, so this
|
|
85
97
|
is also a valid table for style `compact`:
|
|
86
98
|
|
|
@@ -112,7 +124,7 @@ appear aligned in most editors and monospaced fonts:
|
|
|
112
124
|
|
|
113
125
|
Rationale: Consistent formatting makes it easier to understand a document.
|
|
114
126
|
|
|
115
|
-
[cjk-characters]: https://
|
|
116
|
-
[emoji]: https://
|
|
127
|
+
[cjk-characters]: https://wikipedia.org/wiki/CJK_characters
|
|
128
|
+
[emoji]: https://wikipedia.org/wiki/Emoji
|
|
117
129
|
[gfm-table-060]: https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/organizing-information-with-tables
|
|
118
|
-
[latin-script]: https://
|
|
130
|
+
[latin-script]: https://wikipedia.org/wiki/Latin_script
|
package/helpers/README.md
CHANGED
|
@@ -22,8 +22,8 @@ be useful to custom rule authors and may avoid duplicating code.
|
|
|
22
22
|
*None* - The entire body of code is tested to 100% coverage by the core
|
|
23
23
|
`markdownlint` project, so there are no additional tests here.
|
|
24
24
|
|
|
25
|
-
[custom-rules]: https://github.com/DavidAnson/markdownlint/blob/v0.
|
|
26
|
-
[jsdoc]: https://
|
|
27
|
-
[markdown]: https://
|
|
25
|
+
[custom-rules]: https://github.com/DavidAnson/markdownlint/blob/v0.41.0/doc/CustomRules.md
|
|
26
|
+
[jsdoc]: https://wikipedia.org/wiki/JSDoc
|
|
27
|
+
[markdown]: https://wikipedia.org/wiki/Markdown
|
|
28
28
|
[markdownlint]: https://github.com/DavidAnson/markdownlint
|
|
29
|
-
[rules]: https://github.com/DavidAnson/markdownlint/blob/v0.
|
|
29
|
+
[rules]: https://github.com/DavidAnson/markdownlint/blob/v0.41.0/doc/Rules.md
|