mirror of
https://github.com/Kilo-Org/kilocode.git
synced 2026-08-28 19:11:03 +08:00
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:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user