Update MD060/table-column-style to account for emoji and CJK characters rendering at 2x Latin width (fixes #1869).

This commit is contained in:
David Anson 2025-11-25 14:15:50 -08:00
parent ec380a87c0
commit 9b116ae889
13 changed files with 254 additions and 61 deletions

View file

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

View file

@ -556,8 +556,6 @@ Generated by [AVA](https://avajs.dev).
test-repos/v8-v8-dev/src/features/promise-combinators.md:23 error MD058/blanks-around-tables Tables should be surrounded by blank lines [Context: "| name ..."]␊
test-repos/v8-v8-dev/src/features/promise-combinators.md:28 error MD058/blanks-around-tables Tables should be surrounded by blank lines [Context: "| [\`Promise.any\`](#promise.any..."]␊
test-repos/v8-v8-dev/src/features/promise-combinators.md:25:172 error MD060/table-column-style Table column style [Table pipe does not align with heading for style "aligned"]␊
test-repos/v8-v8-dev/src/features/promise-combinators.md:26:162 error MD060/table-column-style Table column style [Table pipe does not align with heading for style "aligned"]␊
test-repos/v8-v8-dev/src/features/promise-combinators.md:27:162 error MD060/table-column-style Table column style [Table pipe does not align with heading for style "aligned"]␊
test-repos/v8-v8-dev/src/features/promise-combinators.md:28:172 error MD060/table-column-style Table column style [Table pipe does not align with heading for style "aligned"]␊
test-repos/v8-v8-dev/src/features/promise-finally.md:82:1 error MD033/no-inline-html Inline HTML [Element: feature-support]␊
test-repos/v8-v8-dev/src/features/regexp-match-indices.md:134:1 error MD033/no-inline-html Inline HTML [Element: feature-support]␊

View file

@ -67803,7 +67803,7 @@ Generated by [AVA](https://avajs.dev).
errorContext: null,
errorDetail: 'Table pipe does not align with heading for style "aligned"',
errorRange: [
19,
20,
1,
],
fixInfo: null,
@ -67857,9 +67857,9 @@ Generated by [AVA](https://avajs.dev).
| Response | Emoji |␊
| -------- | ----- |␊
| Yes | ✅ |␊
| No | ❎ |␊
| Oops | ❌ |␊
| Yes | ✅ |␊
| No | ❎ |␊
| Oops | ❌ |␊
{MD060:-2}␊
@ -72533,6 +72533,72 @@ Generated by [AVA](https://avajs.dev).
`,
}
## table-column-style-wide-characters.md
> Snapshot 1
{
errors: [],
fixed: `# Table Column Style - Wide Characters␊
## Emoji␊
| AB | CD |␊
| -- | -- |␊
| EF | GH |␊
| ✅ | KL |␊
| MN | ✅ |␊
| ✅ | ✅ |␊
| ✅ | CD |␊
| -- | -- |␊
| EF | GH |␊
| ✅ | KL |␊
| MN | ✅ |␊
| ✅ | ✅ |␊
| AB | ✅ |␊
| -- | -- |␊
| EF | GH |␊
| ✅ | KL |␊
| MN | ✅ |␊
| ✅ | ✅ |␊
| ✅ | ✅ |␊
| -- | -- |␊
| EF | GH |␊
| ✅ | KL |␊
| MN | ✅ |␊
| ✅ | ✅ |␊
## Hello World␊
| Language | Translation |␊
|---------------------|----------------|␊
| Emoji | 👋🌎 |␊
| Portuguese (Brazil) | Olá mundo |␊
| Turkish | Merhaba dünya |␊
| Chinese (Mandarin) | 你好,世界 |␊
| Japanese | こんにちは世界 |␊
| Korean | 안녕 세상 |␊
## ANSI Escape Codes␊
| Style | Escape codes |␊
| --------- | ------------------------------------------------------- |␊
| Bold | \\u001B[1m大胆な\\u001B[22m |␊
| Underline | \\u001B[4mUnderline\\u001B[0m |␊
| Link | \\u001B]8;;https://example.com\\u0007Link\\u001B]8;;\\u0007 |␊
<!-- markdownlint-configure-file {␊
"no-bare-urls": false,␊
"table-column-style": {␊
"style": "aligned"␊
}␊
} -->␊
`,
}
## table-content-with-issues.md
> Snapshot 1

View file

@ -4,9 +4,9 @@
| Response | Emoji |
| -------- | ----- |
| Yes | ✅ |
| No | ❎ |
| Oops | ❌ |
| Yes | ✅ |
| No | ❎ |
| Oops | ❌ |
{MD060:-2}

View file

@ -0,0 +1,57 @@
# Table Column Style - Wide Characters
## Emoji
| AB | CD |
| -- | -- |
| EF | GH |
| ✅ | KL |
| MN | ✅ |
| ✅ | ✅ |
| ✅ | CD |
| -- | -- |
| EF | GH |
| ✅ | KL |
| MN | ✅ |
| ✅ | ✅ |
| AB | ✅ |
| -- | -- |
| EF | GH |
| ✅ | KL |
| MN | ✅ |
| ✅ | ✅ |
| ✅ | ✅ |
| -- | -- |
| EF | GH |
| ✅ | KL |
| MN | ✅ |
| ✅ | ✅ |
## Hello World
| Language | Translation |
|---------------------|----------------|
| Emoji | 👋🌎 |
| Portuguese (Brazil) | Olá mundo |
| Turkish | Merhaba dünya |
| Chinese (Mandarin) | 你好,世界 |
| Japanese | こんにちは世界 |
| Korean | 안녕 세상 |
## ANSI Escape Codes
| Style | Escape codes |
| --------- | ------------------------------------------------------- |
| Bold | \u001B[1m大胆な\u001B[22m |
| Underline | \u001B[4mUnderline\u001B[0m |
| Link | \u001B]8;;https://example.com\u0007Link\u001B]8;;\u0007 |
<!-- markdownlint-configure-file {
"no-bare-urls": false,
"table-column-style": {
"style": "aligned"
}
} -->