Skip to content

Commit c83afe1

Browse files
committed
Update documentation for MD013/line-length to call out a missing scenario and be more explicit about strict/stern behavior (refs #1154).
1 parent 82441fa commit c83afe1

3 files changed

Lines changed: 24 additions & 21 deletions

File tree

doc-build/md013.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ For example (assuming normal behavior):
1616
```markdown
1717
IF THIS LINE IS THE MAXIMUM LENGTH
1818
This line is okay because there are-no-spaces-beyond-that-length
19-
And this line is a violation because there are
20-
This-line-is-also-okay-because-there-are-no-spaces
19+
This line is a violation because there are spaces beyond that length
20+
This-line-is-okay-because-there-are-no-spaces-anywhere-within
2121
```
2222

23-
In `strict` or `stern` modes, the two middle lines above are a violation. The
24-
third line is a violation in `strict` mode but allowed in `stern` mode.
23+
In `strict` mode, the last three lines above are all violations. In `stern`
24+
mode, the middle two lines above are both violations, but the last is okay.
2525

2626
You have the option to exclude this rule for code blocks, tables, or headings.
2727
To do so, set the `code_blocks`, `tables`, or `headings` parameter(s) to false.
@@ -30,9 +30,10 @@ Code blocks are included in this rule by default since it is often a
3030
requirement for document readability, and tentatively compatible with code
3131
rules. Still, some languages do not lend themselves to short lines.
3232

33-
Lines with link/image reference definitions are always exempted from this rule
34-
(even in `strict` mode) because there is generally no way to split such lines
35-
without breaking the URL.
33+
Lines with link/image reference definitions and standalone lines (i.e., not part
34+
of a paragraph) with only a link/image (possibly using (strong) emphasis) are
35+
always exempted from this rule (even in `strict` mode) because there is often no
36+
way to split such lines without breaking the URL.
3637

3738
Rationale: Extremely long lines can be difficult to work with in some editors.
3839
More information: <https://cirosantilli.com/markdown-style-guide#line-wrapping>.

doc/Rules.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -495,12 +495,12 @@ For example (assuming normal behavior):
495495
```markdown
496496
IF THIS LINE IS THE MAXIMUM LENGTH
497497
This line is okay because there are-no-spaces-beyond-that-length
498-
And this line is a violation because there are
499-
This-line-is-also-okay-because-there-are-no-spaces
498+
This line is a violation because there are spaces beyond that length
499+
This-line-is-okay-because-there-are-no-spaces-anywhere-within
500500
```
501501

502-
In `strict` or `stern` modes, the two middle lines above are a violation. The
503-
third line is a violation in `strict` mode but allowed in `stern` mode.
502+
In `strict` mode, the last three lines above are all violations. In `stern`
503+
mode, the middle two lines above are both violations, but the last is okay.
504504

505505
You have the option to exclude this rule for code blocks, tables, or headings.
506506
To do so, set the `code_blocks`, `tables`, or `headings` parameter(s) to false.
@@ -509,9 +509,10 @@ Code blocks are included in this rule by default since it is often a
509509
requirement for document readability, and tentatively compatible with code
510510
rules. Still, some languages do not lend themselves to short lines.
511511

512-
Lines with link/image reference definitions are always exempted from this rule
513-
(even in `strict` mode) because there is generally no way to split such lines
514-
without breaking the URL.
512+
Lines with link/image reference definitions and standalone lines (i.e., not part
513+
of a paragraph) with only a link/image (possibly using (strong) emphasis) are
514+
always exempted from this rule (even in `strict` mode) because there is often no
515+
way to split such lines without breaking the URL.
515516

516517
Rationale: Extremely long lines can be difficult to work with in some editors.
517518
More information: <https://cirosantilli.com/markdown-style-guide#line-wrapping>.

doc/md013.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ For example (assuming normal behavior):
3535
```markdown
3636
IF THIS LINE IS THE MAXIMUM LENGTH
3737
This line is okay because there are-no-spaces-beyond-that-length
38-
And this line is a violation because there are
39-
This-line-is-also-okay-because-there-are-no-spaces
38+
This line is a violation because there are spaces beyond that length
39+
This-line-is-okay-because-there-are-no-spaces-anywhere-within
4040
```
4141

42-
In `strict` or `stern` modes, the two middle lines above are a violation. The
43-
third line is a violation in `strict` mode but allowed in `stern` mode.
42+
In `strict` mode, the last three lines above are all violations. In `stern`
43+
mode, the middle two lines above are both violations, but the last is okay.
4444

4545
You have the option to exclude this rule for code blocks, tables, or headings.
4646
To do so, set the `code_blocks`, `tables`, or `headings` parameter(s) to false.
@@ -49,9 +49,10 @@ Code blocks are included in this rule by default since it is often a
4949
requirement for document readability, and tentatively compatible with code
5050
rules. Still, some languages do not lend themselves to short lines.
5151

52-
Lines with link/image reference definitions are always exempted from this rule
53-
(even in `strict` mode) because there is generally no way to split such lines
54-
without breaking the URL.
52+
Lines with link/image reference definitions and standalone lines (i.e., not part
53+
of a paragraph) with only a link/image (possibly using (strong) emphasis) are
54+
always exempted from this rule (even in `strict` mode) because there is often no
55+
way to split such lines without breaking the URL.
5556

5657
Rationale: Extremely long lines can be difficult to work with in some editors.
5758
More information: <https://cirosantilli.com/markdown-style-guide#line-wrapping>.

0 commit comments

Comments
 (0)