Add scenarios for aligned tables with irregular trailing pipes.

This commit is contained in:
David Anson 2025-12-03 22:05:57 -08:00
parent e645385e2c
commit dc9797828e
4 changed files with 423 additions and 1 deletions

View file

@ -1101,7 +1101,7 @@ test("readme", async(t) => {
}); });
test("validateJsonUsingConfigSchemaStrict", async(t) => { test("validateJsonUsingConfigSchemaStrict", async(t) => {
t.plan(222); t.plan(223);
// @ts-ignore // @ts-ignore
const ajv = new Ajv(ajvOptions); const ajv = new Ajv(ajvOptions);
const validateSchemaStrict = ajv.compile(configSchemaStrict); const validateSchemaStrict = ajv.compile(configSchemaStrict);

View file

@ -68518,6 +68518,324 @@ Generated by [AVA](https://avajs.dev).
`, `,
} }
## table-column-style-irregular-trailing-pipe.md
> Snapshot 1
{
errors: [
{
errorContext: null,
errorDetail: 'Table pipe does not align with header for style "aligned"',
errorRange: [
35,
1,
],
fixInfo: null,
lineNumber: 8,
ruleDescription: 'Table column style',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md',
ruleNames: [
'MD060',
'table-column-style',
],
severity: 'error',
},
{
errorContext: null,
errorDetail: 'Table pipe does not align with header for style "aligned"',
errorRange: [
40,
1,
],
fixInfo: null,
lineNumber: 15,
ruleDescription: 'Table column style',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md',
ruleNames: [
'MD060',
'table-column-style',
],
severity: 'error',
},
{
errorContext: null,
errorDetail: 'Table pipe does not align with header for style "aligned"',
errorRange: [
35,
1,
],
fixInfo: null,
lineNumber: 17,
ruleDescription: 'Table column style',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md',
ruleNames: [
'MD060',
'table-column-style',
],
severity: 'error',
},
{
errorContext: null,
errorDetail: 'Table pipe does not align with header for style "aligned"',
errorRange: [
40,
1,
],
fixInfo: null,
lineNumber: 23,
ruleDescription: 'Table column style',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md',
ruleNames: [
'MD060',
'table-column-style',
],
severity: 'error',
},
{
errorContext: null,
errorDetail: 'Table pipe does not align with header for style "aligned"',
errorRange: [
35,
1,
],
fixInfo: null,
lineNumber: 24,
ruleDescription: 'Table column style',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md',
ruleNames: [
'MD060',
'table-column-style',
],
severity: 'error',
},
{
errorContext: null,
errorDetail: 'Table pipe does not align with header for style "aligned"',
errorRange: [
30,
1,
],
fixInfo: null,
lineNumber: 31,
ruleDescription: 'Table column style',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md',
ruleNames: [
'MD060',
'table-column-style',
],
severity: 'error',
},
{
errorContext: null,
errorDetail: 'Table pipe does not align with header for style "aligned"',
errorRange: [
30,
1,
],
fixInfo: null,
lineNumber: 37,
ruleDescription: 'Table column style',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md',
ruleNames: [
'MD060',
'table-column-style',
],
severity: 'error',
},
{
errorContext: null,
errorDetail: 'Table pipe does not align with header for style "aligned"',
errorRange: [
30,
1,
],
fixInfo: null,
lineNumber: 38,
ruleDescription: 'Table column style',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md',
ruleNames: [
'MD060',
'table-column-style',
],
severity: 'error',
},
{
errorContext: null,
errorDetail: 'Table pipe does not align with header for style "aligned"',
errorRange: [
30,
1,
],
fixInfo: null,
lineNumber: 39,
ruleDescription: 'Table column style',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md',
ruleNames: [
'MD060',
'table-column-style',
],
severity: 'error',
},
{
errorContext: null,
errorDetail: 'Table pipe does not align with header for style "aligned"',
errorRange: [
37,
1,
],
fixInfo: null,
lineNumber: 44,
ruleDescription: 'Table column style',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md',
ruleNames: [
'MD060',
'table-column-style',
],
severity: 'error',
},
{
errorContext: null,
errorDetail: 'Table pipe does not align with header for style "aligned"',
errorRange: [
38,
1,
],
fixInfo: null,
lineNumber: 53,
ruleDescription: 'Table column style',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md',
ruleNames: [
'MD060',
'table-column-style',
],
severity: 'error',
},
{
errorContext: null,
errorDetail: 'Table pipe does not align with header for style "aligned"',
errorRange: [
38,
1,
],
fixInfo: null,
lineNumber: 54,
ruleDescription: 'Table column style',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md060.md',
ruleNames: [
'MD060',
'table-column-style',
],
severity: 'error',
},
],
fixed: `# Table Column Style - Irregular Trailing Pipe␊
## Aligned / Edge Pipes␊
| Heading | Heading | Heading |␊
| ------- | --------- | ------- |␊
| Text | Text text | Text |␊
| Text | Text | Text text |␊
| Text | Text text | Text |␊
{MD060:-3}␊
| Heading | Heading | Heading |␊
| ------- | --------- | ------- |␊
| Text | Text text | Text text text |␊
| Text | Text | Text |␊
| Text | Text text | Text text |␊
{MD060:-2} {MD060:-4}␊
| Heading | Heading | Heading |␊
| ------- | --------- | ------- |␊
| Text | Text text | Text text text |␊
| Text | Text text | Text text |␊
{MD060:-2} {MD060:-3}␊
| Heading | Heading | Heading |␊
| ------- | --------- | ------- |␊
| Text | Text text | Text |␊
| Text | Text | Text |␊
| Text | Text text | Text |␊
{MD060:-3}␊
| Heading | Heading | Heading |␊
| ------- | --------- | ---- |␊
| Text | Text text | Text |␊
| Text | Text text | Text |␊
{MD060:-2} {MD060:-3} {MD060:-4}␊
| Heading | Heading | Heading |␊
| ------- | --------- | ----------- |␊
| Text | Text text | Text text |␊
| Text | Text text | Text text |␊
{MD060:-4}␊
| Heading | Heading |␊
| ------- | ------- |␊
| Text | Text |␊
| Text | Text text text text |␊
| Text | Text text text text text |␊
{MD060:-2} {MD060:-3}␊
## Aligned / No Edge Pipes␊
Heading | Heading | Heading␊
------- | --------- | -------␊
Text | Text text | Text␊
Text | Text | Text text␊
Text | Text text | Text␊
Heading | Heading | Heading␊
------- | --------- | -------␊
Text | Text text | Text text text␊
Text | Text | Text␊
Text | Text text | Text text␊
Heading | Heading | Heading␊
------- | --------- | -------␊
Text | Text text | Text text text␊
Text | Text text | Text text␊
Heading | Heading | Heading␊
------- | --------- | -------␊
Text | Text text | Text␊
Text | Text | Text␊
Text | Text text | Text␊
Heading | Heading | Heading␊
------- | --------- | ----␊
Text | Text text | Text␊
Text | Text text | Text␊
Heading | Heading | Heading␊
------- | --------- | ---------␊
Text | Text text | Text␊
Text | Text text | Text␊
Heading | Heading␊
------- | -------␊
Text | Text␊
Text | Text text text text␊
Text | Text text text text text␊
<!-- markdownlint-configure-file {␊
"table-column-style": {␊
"style": "aligned"␊
},␊
"table-pipe-style": false␊
} -->␊
`,
}
## table-column-style-tight.md ## table-column-style-tight.md
> Snapshot 1 > Snapshot 1

View file

@ -0,0 +1,104 @@
# Table Column Style - Irregular Trailing Pipe
## Aligned / Edge Pipes
| Heading | Heading | Heading |
| ------- | --------- | ------- |
| Text | Text text | Text |
| Text | Text | Text text |
| Text | Text text | Text |
{MD060:-3}
| Heading | Heading | Heading |
| ------- | --------- | ------- |
| Text | Text text | Text text text |
| Text | Text | Text |
| Text | Text text | Text text |
{MD060:-2} {MD060:-4}
| Heading | Heading | Heading |
| ------- | --------- | ------- |
| Text | Text text | Text text text |
| Text | Text text | Text text |
{MD060:-2} {MD060:-3}
| Heading | Heading | Heading |
| ------- | --------- | ------- |
| Text | Text text | Text |
| Text | Text | Text |
| Text | Text text | Text |
{MD060:-3}
| Heading | Heading | Heading |
| ------- | --------- | ---- |
| Text | Text text | Text |
| Text | Text text | Text |
{MD060:-2} {MD060:-3} {MD060:-4}
| Heading | Heading | Heading |
| ------- | --------- | ----------- |
| Text | Text text | Text text |
| Text | Text text | Text text |
{MD060:-4}
| Heading | Heading |
| ------- | ------- |
| Text | Text |
| Text | Text text text text |
| Text | Text text text text text |
{MD060:-2} {MD060:-3}
## Aligned / No Edge Pipes
Heading | Heading | Heading
------- | --------- | -------
Text | Text text | Text
Text | Text | Text text
Text | Text text | Text
Heading | Heading | Heading
------- | --------- | -------
Text | Text text | Text text text
Text | Text | Text
Text | Text text | Text text
Heading | Heading | Heading
------- | --------- | -------
Text | Text text | Text text text
Text | Text text | Text text
Heading | Heading | Heading
------- | --------- | -------
Text | Text text | Text
Text | Text | Text
Text | Text text | Text
Heading | Heading | Heading
------- | --------- | ----
Text | Text text | Text
Text | Text text | Text
Heading | Heading | Heading
------- | --------- | ---------
Text | Text text | Text
Text | Text text | Text
Heading | Heading
------- | -------
Text | Text
Text | Text text text text
Text | Text text text text text
<!-- markdownlint-configure-file {
"table-column-style": {
"style": "aligned"
},
"table-pipe-style": false
} -->