diff --git a/test/markdownlint-test.mjs b/test/markdownlint-test.mjs index b96d9eee..1696c0f4 100644 --- a/test/markdownlint-test.mjs +++ b/test/markdownlint-test.mjs @@ -1101,7 +1101,7 @@ test("readme", async(t) => { }); test("validateJsonUsingConfigSchemaStrict", async(t) => { - t.plan(222); + t.plan(223); // @ts-ignore const ajv = new Ajv(ajvOptions); const validateSchemaStrict = ajv.compile(configSchemaStrict); diff --git a/test/snapshots/markdownlint-test-scenarios.mjs.md b/test/snapshots/markdownlint-test-scenarios.mjs.md index e6ca9954..393300c4 100644 --- a/test/snapshots/markdownlint-test-scenarios.mjs.md +++ b/test/snapshots/markdownlint-test-scenarios.mjs.md @@ -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␊ + ␊ + ␊ + `, + } + ## table-column-style-tight.md > Snapshot 1 diff --git a/test/snapshots/markdownlint-test-scenarios.mjs.snap b/test/snapshots/markdownlint-test-scenarios.mjs.snap index b4b1261d..7ec9f46c 100644 Binary files a/test/snapshots/markdownlint-test-scenarios.mjs.snap and b/test/snapshots/markdownlint-test-scenarios.mjs.snap differ diff --git a/test/table-column-style-irregular-trailing-pipe.md b/test/table-column-style-irregular-trailing-pipe.md new file mode 100644 index 00000000..0a36e24d --- /dev/null +++ b/test/table-column-style-irregular-trailing-pipe.md @@ -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 + +