wip
Some checks failed
Checkers / linkcheck (push) Has been cancelled
Checkers / spellcheck (push) Has been cancelled
CI / build (20, macos-latest) (push) Has been cancelled
CI / build (20, ubuntu-latest) (push) Has been cancelled
CI / build (20, windows-latest) (push) Has been cancelled
CI / build (22, macos-latest) (push) Has been cancelled
CI / build (22, ubuntu-latest) (push) Has been cancelled
CI / build (22, windows-latest) (push) Has been cancelled
CI / build (24, macos-latest) (push) Has been cancelled
CI / build (24, ubuntu-latest) (push) Has been cancelled
CI / build (24, windows-latest) (push) Has been cancelled
CI / pnpm (push) Has been cancelled
CodeQL / Analyze (push) Has been cancelled
TestRepos / build (latest, ubuntu-latest) (push) Has been cancelled
UpdateTestRepos / update (push) Has been cancelled

This commit is contained in:
David Anson 2025-11-24 14:59:08 -08:00
parent 3ea07a7614
commit a7b36a5b1b
3 changed files with 78 additions and 33 deletions

View file

@ -3,7 +3,7 @@ This rule is triggered when the column separators of a
This rule recognizes three table column styles based on popular use: This rule recognizes three table column styles based on popular use:
Style `aligned` looks the most like a table: Style `aligned` ensures table delimiters are vertically aligned and orderly:
```markdown ```markdown
| Character | Meaning | | Character | Meaning |
@ -12,7 +12,16 @@ Style `aligned` looks the most like a table:
| N | No | | N | No |
``` ```
Style `compact` uses a single space to pad cell content: The `aligned` style ignores cell content, so the following is also valid:
```markdown
| Character | Meaning |
|-----------|---------|
| Y | Yes |
| N | No |
```
Style `compact` avoids extra padding with a single space around cell content:
```markdown ```markdown
| Character | Meaning | | Character | Meaning |
@ -21,7 +30,7 @@ Style `compact` uses a single space to pad cell content:
| N | No | | N | No |
``` ```
Style `tight` uses no padding for cell content: Style `tight` uses no padding at all for cell content:
```markdown ```markdown
|Character|Meaning| |Character|Meaning|
@ -31,15 +40,18 @@ Style `tight` uses no padding for cell content:
``` ```
When this rule's `style` parameter is set to `aligned`, `compact`, or `tight`, When this rule's `style` parameter is set to `aligned`, `compact`, or `tight`,
every table must match the corresponding pattern and errors will be reported for every table must match the corresponding pattern and any violations will be
any violations. By default, or when the `any` style is used, each table is reported for. By default, or when the `any` style is used, each table is
analyzed to see if it satisfies any supported style. If so, no errors are analyzed to see if it satisfies any supported style. If so, no violations are
reported. If not, errors are be reported for whichever style would produce the reported. If not, violations are be reported for whichever style would produce
*fewest* errors (i.e., whichever style is the closest match). the *fewest* issues (i.e., whichever style is the closest match).
Note: Pipe alignment for the `aligned` style is based on ... Note: Delimiter placement for the `aligned` style is based on visual appearance
The following table is correctly aligned based on character count, though some and not character count. Because editors typically render [emoji][emoji] and
editors render the emoji wider: [CJK characters][cjk-characters] at *twice* the width of
[Latin characters][latin-script], this rule takes that into account for tables
using the `aligned` style. The following table is therefore correctly formatted
and will appear aligned in most editors and monospaced fonts:
<!-- markdownlint-capture --> <!-- markdownlint-capture -->
<!-- markdownlint-disable extended-ascii --> <!-- markdownlint-disable extended-ascii -->
@ -55,4 +67,7 @@ editors render the emoji wider:
Rationale: Consistent formatting makes it easier to understand a document. Rationale: Consistent formatting makes it easier to understand a document.
[cjk-characters]: https://en.wikipedia.org/wiki/CJK_characters
[emoji]: https://en.wikipedia.org/wiki/Emoji
[gfm-table-060]: https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/organizing-information-with-tables [gfm-table-060]: https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/organizing-information-with-tables
[latin-script]: https://en.wikipedia.org/wiki/Latin_script

View file

@ -2702,7 +2702,7 @@ This rule is triggered when the column separators of a
This rule recognizes three table column styles based on popular use: This rule recognizes three table column styles based on popular use:
Style `aligned` looks the most like a table: Style `aligned` ensures table delimiters are vertically aligned and orderly:
```markdown ```markdown
| Character | Meaning | | Character | Meaning |
@ -2711,7 +2711,16 @@ Style `aligned` looks the most like a table:
| N | No | | N | No |
``` ```
Style `compact` uses a single space to pad cell content: The `aligned` style ignores cell content, so the following is also valid:
```markdown
| Character | Meaning |
|-----------|---------|
| Y | Yes |
| N | No |
```
Style `compact` avoids extra padding with a single space around cell content:
```markdown ```markdown
| Character | Meaning | | Character | Meaning |
@ -2720,7 +2729,7 @@ Style `compact` uses a single space to pad cell content:
| N | No | | N | No |
``` ```
Style `tight` uses no padding for cell content: Style `tight` uses no padding at all for cell content:
```markdown ```markdown
|Character|Meaning| |Character|Meaning|
@ -2730,15 +2739,18 @@ Style `tight` uses no padding for cell content:
``` ```
When this rule's `style` parameter is set to `aligned`, `compact`, or `tight`, When this rule's `style` parameter is set to `aligned`, `compact`, or `tight`,
every table must match the corresponding pattern and errors will be reported for every table must match the corresponding pattern and any violations will be
any violations. By default, or when the `any` style is used, each table is reported for. By default, or when the `any` style is used, each table is
analyzed to see if it satisfies any supported style. If so, no errors are analyzed to see if it satisfies any supported style. If so, no violations are
reported. If not, errors are be reported for whichever style would produce the reported. If not, violations are be reported for whichever style would produce
*fewest* errors (i.e., whichever style is the closest match). the *fewest* issues (i.e., whichever style is the closest match).
Note: Pipe alignment for the `aligned` style is based on ... Note: Delimiter placement for the `aligned` style is based on visual appearance
The following table is correctly aligned based on character count, though some and not character count. Because editors typically render [emoji][emoji] and
editors render the emoji wider: [CJK characters][cjk-characters] at *twice* the width of
[Latin characters][latin-script], this rule takes that into account for tables
using the `aligned` style. The following table is therefore correctly formatted
and will appear aligned in most editors and monospaced fonts:
<!-- markdownlint-capture --> <!-- markdownlint-capture -->
<!-- markdownlint-disable extended-ascii --> <!-- markdownlint-disable extended-ascii -->
@ -2754,7 +2766,10 @@ editors render the emoji wider:
Rationale: Consistent formatting makes it easier to understand a document. Rationale: Consistent formatting makes it easier to understand a document.
[cjk-characters]: https://en.wikipedia.org/wiki/CJK_characters
[emoji]: https://en.wikipedia.org/wiki/Emoji
[gfm-table-060]: https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/organizing-information-with-tables [gfm-table-060]: https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/organizing-information-with-tables
[latin-script]: https://en.wikipedia.org/wiki/Latin_script
<!-- markdownlint-configure-file { <!-- markdownlint-configure-file {
"no-inline-html": { "no-inline-html": {

View file

@ -14,7 +14,7 @@ This rule is triggered when the column separators of a
This rule recognizes three table column styles based on popular use: This rule recognizes three table column styles based on popular use:
Style `aligned` looks the most like a table: Style `aligned` ensures table delimiters are vertically aligned and orderly:
```markdown ```markdown
| Character | Meaning | | Character | Meaning |
@ -23,7 +23,16 @@ Style `aligned` looks the most like a table:
| N | No | | N | No |
``` ```
Style `compact` uses a single space to pad cell content: The `aligned` style ignores cell content, so the following is also valid:
```markdown
| Character | Meaning |
|-----------|---------|
| Y | Yes |
| N | No |
```
Style `compact` avoids extra padding with a single space around cell content:
```markdown ```markdown
| Character | Meaning | | Character | Meaning |
@ -32,7 +41,7 @@ Style `compact` uses a single space to pad cell content:
| N | No | | N | No |
``` ```
Style `tight` uses no padding for cell content: Style `tight` uses no padding at all for cell content:
```markdown ```markdown
|Character|Meaning| |Character|Meaning|
@ -42,15 +51,18 @@ Style `tight` uses no padding for cell content:
``` ```
When this rule's `style` parameter is set to `aligned`, `compact`, or `tight`, When this rule's `style` parameter is set to `aligned`, `compact`, or `tight`,
every table must match the corresponding pattern and errors will be reported for every table must match the corresponding pattern and any violations will be
any violations. By default, or when the `any` style is used, each table is reported for. By default, or when the `any` style is used, each table is
analyzed to see if it satisfies any supported style. If so, no errors are analyzed to see if it satisfies any supported style. If so, no violations are
reported. If not, errors are be reported for whichever style would produce the reported. If not, violations are be reported for whichever style would produce
*fewest* errors (i.e., whichever style is the closest match). the *fewest* issues (i.e., whichever style is the closest match).
Note: Pipe alignment for the `aligned` style is based on ... Note: Delimiter placement for the `aligned` style is based on visual appearance
The following table is correctly aligned based on character count, though some and not character count. Because editors typically render [emoji][emoji] and
editors render the emoji wider: [CJK characters][cjk-characters] at *twice* the width of
[Latin characters][latin-script], this rule takes that into account for tables
using the `aligned` style. The following table is therefore correctly formatted
and will appear aligned in most editors and monospaced fonts:
<!-- markdownlint-capture --> <!-- markdownlint-capture -->
<!-- markdownlint-disable extended-ascii --> <!-- markdownlint-disable extended-ascii -->
@ -66,4 +78,7 @@ editors render the emoji wider:
Rationale: Consistent formatting makes it easier to understand a document. Rationale: Consistent formatting makes it easier to understand a document.
[cjk-characters]: https://en.wikipedia.org/wiki/CJK_characters
[emoji]: https://en.wikipedia.org/wiki/Emoji
[gfm-table-060]: https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/organizing-information-with-tables [gfm-table-060]: https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/organizing-information-with-tables
[latin-script]: https://en.wikipedia.org/wiki/Latin_script