You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit df4a10a
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: markdownlint-rules/README.md
+7-4Lines changed: 7 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,9 +35,12 @@ Some rules are **fixable** (heading-title-case, ascii-only, heading-numbering, n
35
35
For a single file listing every rule and option in this package, see [.markdownlint.clean.yml](.markdownlint.clean.yml).
36
36
Only rules that accept options are documented with a config section below.
37
37
**Regex patterns in YAML:** use single quotes so backslashes are not interpreted by YAML (e.g. `'\s'` instead of `"\\s"`), avoiding unnecessary double escapes.
38
-
-**Suppressing a rule for a line:** Every custom rule supports an HTML comment override.
39
-
Put `<!-- rule-name allow -->` on its own line immediately before the line to suppress, or at the end of the violating line.
40
-
Example: `<!-- no-empty-heading allow -->` on the previous line (or at end of the heading line) suppresses that heading's empty-section violation.
38
+
-**Suppressing a rule:** Every custom rule supports HTML comment overrides.
39
+
-**One-off:** Put `<!-- rule-name allow -->` on its own line immediately before the line to suppress, or at the end of the violating line.
40
+
-**Block:** Put `<!-- rule-name disable -->` on its own line to turn the rule off; put `<!-- rule-name enable -->` on its own line to turn it back on.
41
+
All lines between disable and enable (and after disable if there is no enable) are suppressed.
42
+
Example: `<!-- no-empty-heading allow -->` on the previous line suppresses that heading's empty-section violation.
43
+
Example block: `<!-- ................ ....... -->` then several empty headings, then `<!-- ................ ...... -->` so the next empty heading errors again.
41
44
42
45
## Reusing These Rules
43
46
@@ -686,7 +689,7 @@ When reusing any rule, copy `utils.js` into your `.markdownlint-rules` (see [Reu
686
689
When the file path matches any pattern, the rule is skipped for that file.
687
690
This uses `pathMatchesAny` from `utils.js`.
688
691
689
-
- **HTML comment suppress:** `isRuleSuppressedByComment(lines, lineNumber, ruleName)` - returns true when the line or the previous line contains `<!-- ruleName allow -->` (used by all rules for per-line override).
692
+
- **HTML comment suppress:** `isRuleSuppressedByComment(lines, lineNumber, ruleName)` - returns true when (1) the line or the previous line contains `<!-- ruleName allow -->`, or (2) the line is inside a block between `<!-- ruleName disable -->` and `<!-- ruleName enable -->` (used by all rules for per-line and block override).
690
693
Also accepts markdownlint's cleared form (comment body replaced with dots).
0 commit comments