mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-16 22:10:13 +01:00
Update MD060/table-column-style to rename "heading" to "header" for consistency with GFM specification.
Some checks failed
Checkers / linkcheck (push) Has been cancelled
Checkers / spellcheck (push) Has been cancelled
CI / build (20, macos-latest) (push) Has been cancelled
CI / build (20, ubuntu-latest) (push) Has been cancelled
CI / build (20, windows-latest) (push) Has been cancelled
CI / build (22, macos-latest) (push) Has been cancelled
CI / build (22, ubuntu-latest) (push) Has been cancelled
CI / build (22, windows-latest) (push) Has been cancelled
CI / build (24, macos-latest) (push) Has been cancelled
CI / build (24, ubuntu-latest) (push) Has been cancelled
CI / build (24, windows-latest) (push) Has been cancelled
CI / pnpm (push) Has been cancelled
CodeQL / Analyze (push) Has been cancelled
TestRepos / build (latest, ubuntu-latest) (push) Has been cancelled
UpdateTestRepos / update (push) Has been cancelled
Some checks failed
Checkers / linkcheck (push) Has been cancelled
Checkers / spellcheck (push) Has been cancelled
CI / build (20, macos-latest) (push) Has been cancelled
CI / build (20, ubuntu-latest) (push) Has been cancelled
CI / build (20, windows-latest) (push) Has been cancelled
CI / build (22, macos-latest) (push) Has been cancelled
CI / build (22, ubuntu-latest) (push) Has been cancelled
CI / build (22, windows-latest) (push) Has been cancelled
CI / build (24, macos-latest) (push) Has been cancelled
CI / build (24, ubuntu-latest) (push) Has been cancelled
CI / build (24, windows-latest) (push) Has been cancelled
CI / pnpm (push) Has been cancelled
CodeQL / Analyze (push) Has been cancelled
TestRepos / build (latest, ubuntu-latest) (push) Has been cancelled
UpdateTestRepos / update (push) Has been cancelled
This commit is contained in:
parent
f6c5369ef4
commit
b3a49a7fed
5 changed files with 205 additions and 205 deletions
|
|
@ -60,13 +60,13 @@ function getTableDividerColumns(lines, row) {
|
|||
function checkStyleAligned(lines, rows, detail) {
|
||||
/** @type {RuleOnErrorInfo[]} */
|
||||
const errorInfos = [];
|
||||
const headingRow = rows[0];
|
||||
const headingDividerColumns = getTableDividerColumns(lines, headingRow);
|
||||
const headerRow = rows[0];
|
||||
const headerDividerColumns = getTableDividerColumns(lines, headerRow);
|
||||
for (const row of rows.slice(1)) {
|
||||
const remainingHeadingDividerColumns = new Set(headingDividerColumns.map((column) => column.effective));
|
||||
const remainingHeaderDividerColumns = new Set(headerDividerColumns.map((column) => column.effective));
|
||||
const rowDividerColumns = getTableDividerColumns(lines, row);
|
||||
for (const dividerColumn of rowDividerColumns) {
|
||||
if ((remainingHeadingDividerColumns.size > 0) && !remainingHeadingDividerColumns.delete(dividerColumn.effective)) {
|
||||
if ((remainingHeaderDividerColumns.size > 0) && !remainingHeaderDividerColumns.delete(dividerColumn.effective)) {
|
||||
addError(errorInfos, row.startLine, dividerColumn.actual, detail);
|
||||
}
|
||||
}
|
||||
|
|
@ -97,7 +97,7 @@ export default {
|
|||
/** @type {RuleOnErrorInfo[]} */
|
||||
const errorsIfAligned = [];
|
||||
if (styleAlignedAllowed) {
|
||||
errorsIfAligned.push(...checkStyleAligned(lines, rows, "Table pipe does not align with heading for style \"aligned\""));
|
||||
errorsIfAligned.push(...checkStyleAligned(lines, rows, "Table pipe does not align with header for style \"aligned\""));
|
||||
}
|
||||
|
||||
// Determine errors for styles "compact" and "tight"
|
||||
|
|
@ -110,7 +110,7 @@ export default {
|
|||
!(styleAlignedAllowed && (errorsIfAligned.length === 0))
|
||||
) {
|
||||
if (alignedDelimiter) {
|
||||
const errorInfos = checkStyleAligned(lines, rows.slice(0, 2), "Table pipe does not align with heading for option \"aligned_delimiter\"");
|
||||
const errorInfos = checkStyleAligned(lines, rows.slice(0, 2), "Table pipe does not align with header for option \"aligned_delimiter\"");
|
||||
errorsIfCompact.push(...errorInfos);
|
||||
errorsIfTight.push(...errorInfos);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue