fix: enforce exact separator form in md-table-padding check

Previously the check trimmed each separator cell before comparing
against the allow-list, which meant `| --- | --- |` passed as
`---`. The documented rule requires the tight `|---|---|` form;
compare the raw cell so space-padded separators fail too.
This commit is contained in:
kiloconnect[bot]
2026-04-28 07:56:48 +00:00
parent 06cd80d1bd
commit acfd742b02
+5 -3
View File
@@ -112,13 +112,15 @@ function check(file: string): Issue[] {
if (isSep(line)) {
const cells = split(line.trim())
for (const cell of cells) {
const t = cell.trim()
if (!ok.has(t)) {
// Cells must be exactly ---, :---, ---: or :---: with no surrounding
// whitespace. Anything longer (or with space padding) is column-width
// alignment and re-pads on every content change.
if (!ok.has(cell)) {
issues.push({
file,
line: i + 1,
kind: "separator",
detail: `separator cell "${cell}" is padded or extended — use ---, :---, ---: or :---:`,
detail: `separator cell "${cell}" is padded or extended — use ---, :---, ---: or :---: with no surrounding spaces`,
})
break
}