Update documentation for MD013/line-length to call out a missing scenario and be more explicit about strict/stern behavior (refs #1154).

This commit is contained in:
David Anson 2024-03-19 21:46:34 -07:00
parent 82441faa91
commit c83afe1cfd
3 changed files with 24 additions and 21 deletions

View file

@ -16,12 +16,12 @@ For example (assuming normal behavior):
```markdown
IF THIS LINE IS THE MAXIMUM LENGTH
This line is okay because there are-no-spaces-beyond-that-length
And this line is a violation because there are
This-line-is-also-okay-because-there-are-no-spaces
This line is a violation because there are spaces beyond that length
This-line-is-okay-because-there-are-no-spaces-anywhere-within
```
In `strict` or `stern` modes, the two middle lines above are a violation. The
third line is a violation in `strict` mode but allowed in `stern` mode.
In `strict` mode, the last three lines above are all violations. In `stern`
mode, the middle two lines above are both violations, but the last is okay.
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.
@ -30,9 +30,10 @@ Code blocks are included in this rule by default since it is often a
requirement for document readability, and tentatively compatible with code
rules. Still, some languages do not lend themselves to short lines.
Lines with link/image reference definitions are always exempted from this rule
(even in `strict` mode) because there is generally no way to split such lines
without breaking the URL.
Lines with link/image reference definitions and standalone lines (i.e., not part
of a paragraph) with only a link/image (possibly using (strong) emphasis) are
always exempted from this rule (even in `strict` mode) because there is often no
way to split such lines without breaking the URL.
Rationale: Extremely long lines can be difficult to work with in some editors.
More information: <https://cirosantilli.com/markdown-style-guide#line-wrapping>.

View file

@ -495,12 +495,12 @@ For example (assuming normal behavior):
```markdown
IF THIS LINE IS THE MAXIMUM LENGTH
This line is okay because there are-no-spaces-beyond-that-length
And this line is a violation because there are
This-line-is-also-okay-because-there-are-no-spaces
This line is a violation because there are spaces beyond that length
This-line-is-okay-because-there-are-no-spaces-anywhere-within
```
In `strict` or `stern` modes, the two middle lines above are a violation. The
third line is a violation in `strict` mode but allowed in `stern` mode.
In `strict` mode, the last three lines above are all violations. In `stern`
mode, the middle two lines above are both violations, but the last is okay.
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.
@ -509,9 +509,10 @@ Code blocks are included in this rule by default since it is often a
requirement for document readability, and tentatively compatible with code
rules. Still, some languages do not lend themselves to short lines.
Lines with link/image reference definitions are always exempted from this rule
(even in `strict` mode) because there is generally no way to split such lines
without breaking the URL.
Lines with link/image reference definitions and standalone lines (i.e., not part
of a paragraph) with only a link/image (possibly using (strong) emphasis) are
always exempted from this rule (even in `strict` mode) because there is often no
way to split such lines without breaking the URL.
Rationale: Extremely long lines can be difficult to work with in some editors.
More information: <https://cirosantilli.com/markdown-style-guide#line-wrapping>.

View file

@ -35,12 +35,12 @@ For example (assuming normal behavior):
```markdown
IF THIS LINE IS THE MAXIMUM LENGTH
This line is okay because there are-no-spaces-beyond-that-length
And this line is a violation because there are
This-line-is-also-okay-because-there-are-no-spaces
This line is a violation because there are spaces beyond that length
This-line-is-okay-because-there-are-no-spaces-anywhere-within
```
In `strict` or `stern` modes, the two middle lines above are a violation. The
third line is a violation in `strict` mode but allowed in `stern` mode.
In `strict` mode, the last three lines above are all violations. In `stern`
mode, the middle two lines above are both violations, but the last is okay.
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.
@ -49,9 +49,10 @@ Code blocks are included in this rule by default since it is often a
requirement for document readability, and tentatively compatible with code
rules. Still, some languages do not lend themselves to short lines.
Lines with link/image reference definitions are always exempted from this rule
(even in `strict` mode) because there is generally no way to split such lines
without breaking the URL.
Lines with link/image reference definitions and standalone lines (i.e., not part
of a paragraph) with only a link/image (possibly using (strong) emphasis) are
always exempted from this rule (even in `strict` mode) because there is often no
way to split such lines without breaking the URL.
Rationale: Extremely long lines can be difficult to work with in some editors.
More information: <https://cirosantilli.com/markdown-style-guide#line-wrapping>.