mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-09-22 05:40:48 +02:00
Reimplement MD021/no-multiple-space-closed-atx using micromark tokens.
This commit is contained in:
parent
e3ca9b1755
commit
0b165c1566
8 changed files with 393 additions and 219 deletions
|
@ -312,17 +312,6 @@ function indentFor(token) {
|
|||
}
|
||||
module.exports.indentFor = indentFor;
|
||||
|
||||
// Returns the heading style for a heading token
|
||||
module.exports.headingStyleFor = function headingStyleFor(token) {
|
||||
if ((token.map[1] - token.map[0]) === 1) {
|
||||
if (/[^\\]#\s*$/.test(token.line)) {
|
||||
return "atx_closed";
|
||||
}
|
||||
return "atx";
|
||||
}
|
||||
return "setext";
|
||||
};
|
||||
|
||||
/**
|
||||
* Return the string representation of an unordered list marker.
|
||||
*
|
||||
|
@ -4264,8 +4253,8 @@ module.exports = {
|
|||
onError,
|
||||
atxHeading.startLine,
|
||||
atxHeading.text.trim(),
|
||||
undefined,
|
||||
undefined,
|
||||
true,
|
||||
false,
|
||||
[ column, length ],
|
||||
{
|
||||
"editColumn": column,
|
||||
|
@ -4367,10 +4356,8 @@ module.exports = {
|
|||
|
||||
|
||||
|
||||
const { addErrorContext, filterTokens, headingStyleFor } =
|
||||
__webpack_require__(/*! ../helpers */ "../helpers/helpers.js");
|
||||
|
||||
const closedAtxRe = /^(#+)([ \t]+)([^ \t]|[^ \t].*[^ \t])([ \t]+)(#+)(\s*)$/;
|
||||
const { addErrorContext } = __webpack_require__(/*! ../helpers */ "../helpers/helpers.js");
|
||||
const { filterByTypes, getHeadingStyle } = __webpack_require__(/*! ../helpers/micromark.cjs */ "../helpers/micromark.cjs");
|
||||
|
||||
// eslint-disable-next-line jsdoc/valid-types
|
||||
/** @type import("./markdownlint").Rule */
|
||||
|
@ -4378,55 +4365,65 @@ module.exports = {
|
|||
"names": [ "MD021", "no-multiple-space-closed-atx" ],
|
||||
"description": "Multiple spaces inside hashes on closed atx style heading",
|
||||
"tags": [ "headings", "atx_closed", "spaces" ],
|
||||
"parser": "markdownit",
|
||||
"parser": "micromark",
|
||||
"function": function MD021(params, onError) {
|
||||
filterTokens(params, "heading_open", (token) => {
|
||||
if (headingStyleFor(token) === "atx_closed") {
|
||||
const { line, lineNumber } = token;
|
||||
const match = closedAtxRe.exec(line);
|
||||
if (match) {
|
||||
const [
|
||||
,
|
||||
leftHash,
|
||||
{ "length": leftSpaceLength },
|
||||
content,
|
||||
{ "length": rightSpaceLength },
|
||||
rightHash,
|
||||
{ "length": trailSpaceLength }
|
||||
] = match;
|
||||
const left = leftSpaceLength > 1;
|
||||
const right = rightSpaceLength > 1;
|
||||
if (left || right) {
|
||||
const length = line.length;
|
||||
const leftHashLength = leftHash.length;
|
||||
const rightHashLength = rightHash.length;
|
||||
const range = left ?
|
||||
[
|
||||
1,
|
||||
leftHashLength + leftSpaceLength + 1
|
||||
] :
|
||||
[
|
||||
length - trailSpaceLength - rightHashLength - rightSpaceLength,
|
||||
rightSpaceLength + rightHashLength + 1
|
||||
];
|
||||
const atxHeadings = filterByTypes(
|
||||
params.parsers.micromark.tokens,
|
||||
[ "atxHeading" ]
|
||||
).filter((heading) => getHeadingStyle(heading) === "atx_closed");
|
||||
for (const atxHeading of atxHeadings) {
|
||||
const [ atxHeadingSequenceStart, whitespaceStart ] = atxHeading.children;
|
||||
if (
|
||||
(atxHeadingSequenceStart?.type === "atxHeadingSequence") &&
|
||||
(whitespaceStart?.type === "whitespace") &&
|
||||
(whitespaceStart.text.length > 1)
|
||||
) {
|
||||
const column = whitespaceStart.startColumn + 1;
|
||||
const length = whitespaceStart.endColumn - column;
|
||||
addErrorContext(
|
||||
onError,
|
||||
lineNumber,
|
||||
line.trim(),
|
||||
left,
|
||||
right,
|
||||
range,
|
||||
atxHeading.startLine,
|
||||
atxHeading.text.trim(),
|
||||
true,
|
||||
false,
|
||||
[ column, length ],
|
||||
{
|
||||
"editColumn": 1,
|
||||
"deleteCount": length,
|
||||
"insertText": `${leftHash} ${content} ${rightHash}`
|
||||
"editColumn": column,
|
||||
"deleteCount": length
|
||||
}
|
||||
);
|
||||
}
|
||||
let endSequenceIndex = atxHeading.children.length - 1;
|
||||
while (
|
||||
(endSequenceIndex > 1) &&
|
||||
(atxHeading.children[endSequenceIndex].type !== "atxHeadingSequence")
|
||||
) {
|
||||
endSequenceIndex--;
|
||||
}
|
||||
const atxHeadingSequenceEnd = atxHeading.children.at(endSequenceIndex);
|
||||
const whitespaceEnd = atxHeading.children.at(endSequenceIndex - 1);
|
||||
if (
|
||||
(atxHeadingSequenceEnd?.type === "atxHeadingSequence") &&
|
||||
(whitespaceEnd?.type === "whitespace") &&
|
||||
(whitespaceEnd.text.length > 1)
|
||||
) {
|
||||
const column = whitespaceEnd.startColumn + 1;
|
||||
const length = whitespaceEnd.endColumn - column;
|
||||
addErrorContext(
|
||||
onError,
|
||||
atxHeading.startLine,
|
||||
atxHeading.text.trim(),
|
||||
false,
|
||||
true,
|
||||
[ column, length ],
|
||||
{
|
||||
"editColumn": column,
|
||||
"deleteCount": length
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -300,17 +300,6 @@ function indentFor(token) {
|
|||
}
|
||||
module.exports.indentFor = indentFor;
|
||||
|
||||
// Returns the heading style for a heading token
|
||||
module.exports.headingStyleFor = function headingStyleFor(token) {
|
||||
if ((token.map[1] - token.map[0]) === 1) {
|
||||
if (/[^\\]#\s*$/.test(token.line)) {
|
||||
return "atx_closed";
|
||||
}
|
||||
return "atx";
|
||||
}
|
||||
return "setext";
|
||||
};
|
||||
|
||||
/**
|
||||
* Return the string representation of an unordered list marker.
|
||||
*
|
||||
|
|
|
@ -30,8 +30,8 @@ module.exports = {
|
|||
onError,
|
||||
atxHeading.startLine,
|
||||
atxHeading.text.trim(),
|
||||
undefined,
|
||||
undefined,
|
||||
true,
|
||||
false,
|
||||
[ column, length ],
|
||||
{
|
||||
"editColumn": column,
|
||||
|
|
96
lib/md021.js
96
lib/md021.js
|
@ -2,10 +2,8 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
const { addErrorContext, filterTokens, headingStyleFor } =
|
||||
require("../helpers");
|
||||
|
||||
const closedAtxRe = /^(#+)([ \t]+)([^ \t]|[^ \t].*[^ \t])([ \t]+)(#+)(\s*)$/;
|
||||
const { addErrorContext } = require("../helpers");
|
||||
const { filterByTypes, getHeadingStyle } = require("../helpers/micromark.cjs");
|
||||
|
||||
// eslint-disable-next-line jsdoc/valid-types
|
||||
/** @type import("./markdownlint").Rule */
|
||||
|
@ -13,53 +11,63 @@ module.exports = {
|
|||
"names": [ "MD021", "no-multiple-space-closed-atx" ],
|
||||
"description": "Multiple spaces inside hashes on closed atx style heading",
|
||||
"tags": [ "headings", "atx_closed", "spaces" ],
|
||||
"parser": "markdownit",
|
||||
"parser": "micromark",
|
||||
"function": function MD021(params, onError) {
|
||||
filterTokens(params, "heading_open", (token) => {
|
||||
if (headingStyleFor(token) === "atx_closed") {
|
||||
const { line, lineNumber } = token;
|
||||
const match = closedAtxRe.exec(line);
|
||||
if (match) {
|
||||
const [
|
||||
,
|
||||
leftHash,
|
||||
{ "length": leftSpaceLength },
|
||||
content,
|
||||
{ "length": rightSpaceLength },
|
||||
rightHash,
|
||||
{ "length": trailSpaceLength }
|
||||
] = match;
|
||||
const left = leftSpaceLength > 1;
|
||||
const right = rightSpaceLength > 1;
|
||||
if (left || right) {
|
||||
const length = line.length;
|
||||
const leftHashLength = leftHash.length;
|
||||
const rightHashLength = rightHash.length;
|
||||
const range = left ?
|
||||
[
|
||||
1,
|
||||
leftHashLength + leftSpaceLength + 1
|
||||
] :
|
||||
[
|
||||
length - trailSpaceLength - rightHashLength - rightSpaceLength,
|
||||
rightSpaceLength + rightHashLength + 1
|
||||
];
|
||||
const atxHeadings = filterByTypes(
|
||||
params.parsers.micromark.tokens,
|
||||
[ "atxHeading" ]
|
||||
).filter((heading) => getHeadingStyle(heading) === "atx_closed");
|
||||
for (const atxHeading of atxHeadings) {
|
||||
const [ atxHeadingSequenceStart, whitespaceStart ] = atxHeading.children;
|
||||
if (
|
||||
(atxHeadingSequenceStart?.type === "atxHeadingSequence") &&
|
||||
(whitespaceStart?.type === "whitespace") &&
|
||||
(whitespaceStart.text.length > 1)
|
||||
) {
|
||||
const column = whitespaceStart.startColumn + 1;
|
||||
const length = whitespaceStart.endColumn - column;
|
||||
addErrorContext(
|
||||
onError,
|
||||
lineNumber,
|
||||
line.trim(),
|
||||
left,
|
||||
right,
|
||||
range,
|
||||
atxHeading.startLine,
|
||||
atxHeading.text.trim(),
|
||||
true,
|
||||
false,
|
||||
[ column, length ],
|
||||
{
|
||||
"editColumn": 1,
|
||||
"deleteCount": length,
|
||||
"insertText": `${leftHash} ${content} ${rightHash}`
|
||||
"editColumn": column,
|
||||
"deleteCount": length
|
||||
}
|
||||
);
|
||||
}
|
||||
let endSequenceIndex = atxHeading.children.length - 1;
|
||||
while (
|
||||
(endSequenceIndex > 1) &&
|
||||
(atxHeading.children[endSequenceIndex].type !== "atxHeadingSequence")
|
||||
) {
|
||||
endSequenceIndex--;
|
||||
}
|
||||
const atxHeadingSequenceEnd = atxHeading.children.at(endSequenceIndex);
|
||||
const whitespaceEnd = atxHeading.children.at(endSequenceIndex - 1);
|
||||
if (
|
||||
(atxHeadingSequenceEnd?.type === "atxHeadingSequence") &&
|
||||
(whitespaceEnd?.type === "whitespace") &&
|
||||
(whitespaceEnd.text.length > 1)
|
||||
) {
|
||||
const column = whitespaceEnd.startColumn + 1;
|
||||
const length = whitespaceEnd.endColumn - column;
|
||||
addErrorContext(
|
||||
onError,
|
||||
atxHeading.startLine,
|
||||
atxHeading.text.trim(),
|
||||
false,
|
||||
true,
|
||||
[ column, length ],
|
||||
{
|
||||
"editColumn": column,
|
||||
"deleteCount": length
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
|
@ -977,3 +977,11 @@ test("endOfLineGemojiCodeRe", async(t) => {
|
|||
t.true(helpers.endOfLineGemojiCodeRe.test(`-:${emoji}:`), emoji);
|
||||
}
|
||||
});
|
||||
|
||||
test("ellipsify", (t) => {
|
||||
t.is(helpers.ellipsify("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"), "abcdefghijklmnopqrstuvwxyzABCD...");
|
||||
t.is(helpers.ellipsify("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", false, false), "abcdefghijklmnopqrstuvwxyzABCD...");
|
||||
t.is(helpers.ellipsify("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", true, false), "abcdefghijklmnopqrstuvwxyzABCD...");
|
||||
t.is(helpers.ellipsify("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", false, true), "...wxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");
|
||||
t.is(helpers.ellipsify("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", true, true), "abcdefghijklmno...LMNOPQRSTUVWXYZ");
|
||||
});
|
||||
|
|
|
@ -167,8 +167,8 @@ test("resultFormattingV1", (t) => new Promise((resolve) => {
|
|||
"Multiple spaces inside hashes on closed atx style heading",
|
||||
"ruleInformation": `${homepage}/blob/v${version}/doc/md021.md`,
|
||||
"errorDetail": null,
|
||||
"errorContext": "# Multiple spa...tyle heading #",
|
||||
"errorRange": [ 1, 4 ] }
|
||||
"errorContext": "# Multiple spaces inside hash...",
|
||||
"errorRange": [ 3, 1 ] }
|
||||
],
|
||||
"./test/atx_heading_spacing.md": [
|
||||
{ "lineNumber": 1,
|
||||
|
@ -237,7 +237,7 @@ test("resultFormattingV1", (t) => new Promise((resolve) => {
|
|||
" [Context: \"## Heading\"]\n" +
|
||||
"truncate: 1: MD021/no-multiple-space-closed-atx" +
|
||||
" Multiple spaces inside hashes on closed atx style heading" +
|
||||
" [Context: \"# Multiple spa...tyle heading #\"]";
|
||||
" [Context: \"# Multiple spaces inside hash...\"]";
|
||||
t.is(actualMessage, expectedMessage, "Incorrect message.");
|
||||
resolve();
|
||||
});
|
||||
|
@ -270,8 +270,8 @@ test("resultFormattingV2", (t) => new Promise((resolve) => {
|
|||
"Multiple spaces inside hashes on closed atx style heading",
|
||||
"ruleInformation": `${homepage}/blob/v${version}/doc/md021.md`,
|
||||
"errorDetail": null,
|
||||
"errorContext": "# Multiple spa...tyle heading #",
|
||||
"errorRange": [ 1, 4 ] }
|
||||
"errorContext": "# Multiple spaces inside hash...",
|
||||
"errorRange": [ 3, 1 ] }
|
||||
],
|
||||
"./test/atx_heading_spacing.md": [
|
||||
{ "lineNumber": 1,
|
||||
|
@ -336,7 +336,7 @@ test("resultFormattingV2", (t) => new Promise((resolve) => {
|
|||
" [Context: \"## Heading\"]\n" +
|
||||
"truncate: 1: MD021/no-multiple-space-closed-atx" +
|
||||
" Multiple spaces inside hashes on closed atx style heading" +
|
||||
" [Context: \"# Multiple spa...tyle heading #\"]";
|
||||
" [Context: \"# Multiple spaces inside hash...\"]";
|
||||
t.is(actualMessage, expectedMessage, "Incorrect message.");
|
||||
resolve();
|
||||
});
|
||||
|
|
|
@ -524,13 +524,12 @@ Generated by [AVA](https://avajs.dev).
|
|||
errorContext: '## Multiple spaces E {MD021} ...',
|
||||
errorDetail: null,
|
||||
errorRange: [
|
||||
4,
|
||||
1,
|
||||
5,
|
||||
],
|
||||
fixInfo: {
|
||||
deleteCount: 32,
|
||||
editColumn: 1,
|
||||
insertText: '## Multiple spaces E {MD021} ##',
|
||||
deleteCount: 1,
|
||||
editColumn: 4,
|
||||
},
|
||||
lineNumber: 22,
|
||||
ruleDescription: 'Multiple spaces inside hashes on closed atx style heading',
|
||||
|
@ -544,13 +543,12 @@ Generated by [AVA](https://avajs.dev).
|
|||
errorContext: '... Multiple spaces F {MD021} ##',
|
||||
errorDetail: null,
|
||||
errorRange: [
|
||||
28,
|
||||
5,
|
||||
30,
|
||||
1,
|
||||
],
|
||||
fixInfo: {
|
||||
deleteCount: 32,
|
||||
editColumn: 1,
|
||||
insertText: '## Multiple spaces F {MD021} ##',
|
||||
deleteCount: 1,
|
||||
editColumn: 30,
|
||||
},
|
||||
lineNumber: 24,
|
||||
ruleDescription: 'Multiple spaces inside hashes on closed atx style heading',
|
||||
|
@ -2701,13 +2699,12 @@ Generated by [AVA](https://avajs.dev).
|
|||
errorContext: '## Heading 5 {MD021} ##',
|
||||
errorDetail: null,
|
||||
errorRange: [
|
||||
1,
|
||||
7,
|
||||
4,
|
||||
3,
|
||||
],
|
||||
fixInfo: {
|
||||
deleteCount: 28,
|
||||
editColumn: 1,
|
||||
insertText: '## Heading 5 {MD021} ##',
|
||||
deleteCount: 3,
|
||||
editColumn: 4,
|
||||
},
|
||||
lineNumber: 15,
|
||||
ruleDescription: 'Multiple spaces inside hashes on closed atx style heading',
|
||||
|
@ -2721,13 +2718,12 @@ Generated by [AVA](https://avajs.dev).
|
|||
errorContext: '## Heading 6 {MD021} ##',
|
||||
errorDetail: null,
|
||||
errorRange: [
|
||||
20,
|
||||
6,
|
||||
22,
|
||||
2,
|
||||
],
|
||||
fixInfo: {
|
||||
deleteCount: 27,
|
||||
editColumn: 1,
|
||||
insertText: '## Heading 6 {MD021} ##',
|
||||
deleteCount: 2,
|
||||
editColumn: 22,
|
||||
},
|
||||
lineNumber: 17,
|
||||
ruleDescription: 'Multiple spaces inside hashes on closed atx style heading',
|
||||
|
@ -2741,13 +2737,31 @@ Generated by [AVA](https://avajs.dev).
|
|||
errorContext: '## Heading 7 {MD021} ##',
|
||||
errorDetail: null,
|
||||
errorRange: [
|
||||
1,
|
||||
7,
|
||||
4,
|
||||
3,
|
||||
],
|
||||
fixInfo: {
|
||||
deleteCount: 30,
|
||||
editColumn: 1,
|
||||
insertText: '## Heading 7 {MD021} ##',
|
||||
deleteCount: 3,
|
||||
editColumn: 4,
|
||||
},
|
||||
lineNumber: 19,
|
||||
ruleDescription: 'Multiple spaces inside hashes on closed atx style heading',
|
||||
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md021.md',
|
||||
ruleNames: [
|
||||
'MD021',
|
||||
'no-multiple-space-closed-atx',
|
||||
],
|
||||
},
|
||||
{
|
||||
errorContext: '## Heading 7 {MD021} ##',
|
||||
errorDetail: null,
|
||||
errorRange: [
|
||||
25,
|
||||
2,
|
||||
],
|
||||
fixInfo: {
|
||||
deleteCount: 2,
|
||||
editColumn: 25,
|
||||
},
|
||||
lineNumber: 19,
|
||||
ruleDescription: 'Multiple spaces inside hashes on closed atx style heading',
|
||||
|
@ -2772,11 +2786,11 @@ Generated by [AVA](https://avajs.dev).
|
|||
␊
|
||||
## Heading 5 {MD020} ##␊
|
||||
␊
|
||||
## Heading 5 {MD021} ##␊
|
||||
## Heading 5 {MD021} ## ␊
|
||||
␊
|
||||
## Heading 6 {MD021} ##␊
|
||||
## Heading 6 {MD021} ## ␊
|
||||
␊
|
||||
## Heading 7 {MD021} ##␊
|
||||
## Heading 7 {MD021} ## ␊
|
||||
`,
|
||||
}
|
||||
|
||||
|
@ -2850,13 +2864,12 @@ Generated by [AVA](https://avajs.dev).
|
|||
errorContext: '## Heading 4 {MD021} ##',
|
||||
errorDetail: null,
|
||||
errorRange: [
|
||||
4,
|
||||
1,
|
||||
5,
|
||||
],
|
||||
fixInfo: {
|
||||
deleteCount: 24,
|
||||
editColumn: 1,
|
||||
insertText: '## Heading 4 {MD021} ##',
|
||||
deleteCount: 1,
|
||||
editColumn: 4,
|
||||
},
|
||||
lineNumber: 7,
|
||||
ruleDescription: 'Multiple spaces inside hashes on closed atx style heading',
|
||||
|
@ -2870,13 +2883,12 @@ Generated by [AVA](https://avajs.dev).
|
|||
errorContext: '## Heading 5 {MD021} ##',
|
||||
errorDetail: null,
|
||||
errorRange: [
|
||||
20,
|
||||
5,
|
||||
22,
|
||||
1,
|
||||
],
|
||||
fixInfo: {
|
||||
deleteCount: 24,
|
||||
editColumn: 1,
|
||||
insertText: '## Heading 5 {MD021} ##',
|
||||
deleteCount: 1,
|
||||
editColumn: 22,
|
||||
},
|
||||
lineNumber: 9,
|
||||
ruleDescription: 'Multiple spaces inside hashes on closed atx style heading',
|
||||
|
@ -2890,13 +2902,31 @@ Generated by [AVA](https://avajs.dev).
|
|||
errorContext: '## Heading 6 {MD021} ##',
|
||||
errorDetail: null,
|
||||
errorRange: [
|
||||
4,
|
||||
1,
|
||||
5,
|
||||
],
|
||||
fixInfo: {
|
||||
deleteCount: 25,
|
||||
editColumn: 1,
|
||||
insertText: '## Heading 6 {MD021} ##',
|
||||
deleteCount: 1,
|
||||
editColumn: 4,
|
||||
},
|
||||
lineNumber: 11,
|
||||
ruleDescription: 'Multiple spaces inside hashes on closed atx style heading',
|
||||
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md021.md',
|
||||
ruleNames: [
|
||||
'MD021',
|
||||
'no-multiple-space-closed-atx',
|
||||
],
|
||||
},
|
||||
{
|
||||
errorContext: '## Heading 6 {MD021} ##',
|
||||
errorDetail: null,
|
||||
errorRange: [
|
||||
23,
|
||||
1,
|
||||
],
|
||||
fixInfo: {
|
||||
deleteCount: 1,
|
||||
editColumn: 23,
|
||||
},
|
||||
lineNumber: 11,
|
||||
ruleDescription: 'Multiple spaces inside hashes on closed atx style heading',
|
||||
|
@ -2910,13 +2940,31 @@ Generated by [AVA](https://avajs.dev).
|
|||
errorContext: '## Heading 7 {MD021} ##',
|
||||
errorDetail: null,
|
||||
errorRange: [
|
||||
1,
|
||||
6,
|
||||
4,
|
||||
2,
|
||||
],
|
||||
fixInfo: {
|
||||
deleteCount: 27,
|
||||
editColumn: 1,
|
||||
insertText: '## Heading 7 {MD021} ##',
|
||||
deleteCount: 2,
|
||||
editColumn: 4,
|
||||
},
|
||||
lineNumber: 13,
|
||||
ruleDescription: 'Multiple spaces inside hashes on closed atx style heading',
|
||||
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md021.md',
|
||||
ruleNames: [
|
||||
'MD021',
|
||||
'no-multiple-space-closed-atx',
|
||||
],
|
||||
},
|
||||
{
|
||||
errorContext: '## Heading 7 {MD021} ##',
|
||||
errorDetail: null,
|
||||
errorRange: [
|
||||
24,
|
||||
2,
|
||||
],
|
||||
fixInfo: {
|
||||
deleteCount: 2,
|
||||
editColumn: 24,
|
||||
},
|
||||
lineNumber: 13,
|
||||
ruleDescription: 'Multiple spaces inside hashes on closed atx style heading',
|
||||
|
@ -7035,16 +7083,34 @@ Generated by [AVA](https://avajs.dev).
|
|||
],
|
||||
},
|
||||
{
|
||||
errorContext: '# Heading 7 {M...021} {MD003} #',
|
||||
errorContext: '# Heading 7 {MD021} {MD003} ...',
|
||||
errorDetail: null,
|
||||
errorRange: [
|
||||
3,
|
||||
1,
|
||||
4,
|
||||
],
|
||||
fixInfo: {
|
||||
deleteCount: 31,
|
||||
editColumn: 1,
|
||||
insertText: '# Heading 7 {MD021} {MD003} #',
|
||||
deleteCount: 1,
|
||||
editColumn: 3,
|
||||
},
|
||||
lineNumber: 31,
|
||||
ruleDescription: 'Multiple spaces inside hashes on closed atx style heading',
|
||||
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md021.md',
|
||||
ruleNames: [
|
||||
'MD021',
|
||||
'no-multiple-space-closed-atx',
|
||||
],
|
||||
},
|
||||
{
|
||||
errorContext: '... Heading 7 {MD021} {MD003} #',
|
||||
errorDetail: null,
|
||||
errorRange: [
|
||||
30,
|
||||
1,
|
||||
],
|
||||
fixInfo: {
|
||||
deleteCount: 1,
|
||||
editColumn: 30,
|
||||
},
|
||||
lineNumber: 31,
|
||||
ruleDescription: 'Multiple spaces inside hashes on closed atx style heading',
|
||||
|
@ -15927,16 +15993,34 @@ Generated by [AVA](https://avajs.dev).
|
|||
],
|
||||
},
|
||||
{
|
||||
errorContext: '## Extra Norma...th) {MD021} ##',
|
||||
errorContext: '## Extra Normal space (both) ...',
|
||||
errorDetail: null,
|
||||
errorRange: [
|
||||
4,
|
||||
1,
|
||||
5,
|
||||
],
|
||||
fixInfo: {
|
||||
deleteCount: 41,
|
||||
editColumn: 1,
|
||||
insertText: '## Extra Normal space (both) {MD021} ##',
|
||||
deleteCount: 1,
|
||||
editColumn: 4,
|
||||
},
|
||||
lineNumber: 29,
|
||||
ruleDescription: 'Multiple spaces inside hashes on closed atx style heading',
|
||||
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md021.md',
|
||||
ruleNames: [
|
||||
'MD021',
|
||||
'no-multiple-space-closed-atx',
|
||||
],
|
||||
},
|
||||
{
|
||||
errorContext: '...ormal space (both) {MD021} ##',
|
||||
errorDetail: null,
|
||||
errorRange: [
|
||||
39,
|
||||
1,
|
||||
],
|
||||
fixInfo: {
|
||||
deleteCount: 1,
|
||||
editColumn: 39,
|
||||
},
|
||||
lineNumber: 29,
|
||||
ruleDescription: 'Multiple spaces inside hashes on closed atx style heading',
|
||||
|
@ -15950,13 +16034,12 @@ Generated by [AVA](https://avajs.dev).
|
|||
errorContext: '## Extra tab (left) {MD021} #...',
|
||||
errorDetail: null,
|
||||
errorRange: [
|
||||
4,
|
||||
1,
|
||||
5,
|
||||
],
|
||||
fixInfo: {
|
||||
deleteCount: 31,
|
||||
editColumn: 1,
|
||||
insertText: '## Extra tab (left) {MD021} ##',
|
||||
deleteCount: 1,
|
||||
editColumn: 4,
|
||||
},
|
||||
lineNumber: 33,
|
||||
ruleDescription: 'Multiple spaces inside hashes on closed atx style heading',
|
||||
|
@ -15970,13 +16053,12 @@ Generated by [AVA](https://avajs.dev).
|
|||
errorContext: '... Extra tab (right) {MD021} ##',
|
||||
errorDetail: null,
|
||||
errorRange: [
|
||||
28,
|
||||
5,
|
||||
30,
|
||||
1,
|
||||
],
|
||||
fixInfo: {
|
||||
deleteCount: 32,
|
||||
editColumn: 1,
|
||||
insertText: '## Extra tab (right) {MD021} ##',
|
||||
deleteCount: 1,
|
||||
editColumn: 30,
|
||||
},
|
||||
lineNumber: 37,
|
||||
ruleDescription: 'Multiple spaces inside hashes on closed atx style heading',
|
||||
|
@ -38011,16 +38093,34 @@ Generated by [AVA](https://avajs.dev).
|
|||
],
|
||||
},
|
||||
{
|
||||
errorContext: '### Heading 3b...1} {MD022} ###',
|
||||
errorContext: '### Heading 3b {MD003} {MD021...',
|
||||
errorDetail: null,
|
||||
errorRange: [
|
||||
5,
|
||||
1,
|
||||
6,
|
||||
],
|
||||
fixInfo: {
|
||||
deleteCount: 44,
|
||||
editColumn: 1,
|
||||
insertText: '### Heading 3b {MD003} {MD021} {MD022} ###',
|
||||
deleteCount: 1,
|
||||
editColumn: 5,
|
||||
},
|
||||
lineNumber: 32,
|
||||
ruleDescription: 'Multiple spaces inside hashes on closed atx style heading',
|
||||
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md021.md',
|
||||
ruleNames: [
|
||||
'MD021',
|
||||
'no-multiple-space-closed-atx',
|
||||
],
|
||||
},
|
||||
{
|
||||
errorContext: '...b {MD003} {MD021} {MD022} ###',
|
||||
errorDetail: null,
|
||||
errorRange: [
|
||||
41,
|
||||
1,
|
||||
],
|
||||
fixInfo: {
|
||||
deleteCount: 1,
|
||||
editColumn: 41,
|
||||
},
|
||||
lineNumber: 32,
|
||||
ruleDescription: 'Multiple spaces inside hashes on closed atx style heading',
|
||||
|
@ -46848,13 +46948,31 @@ Generated by [AVA](https://avajs.dev).
|
|||
errorContext: '# F #',
|
||||
errorDetail: null,
|
||||
errorRange: [
|
||||
3,
|
||||
1,
|
||||
4,
|
||||
],
|
||||
fixInfo: {
|
||||
deleteCount: 7,
|
||||
editColumn: 1,
|
||||
insertText: '# F #',
|
||||
deleteCount: 1,
|
||||
editColumn: 3,
|
||||
},
|
||||
lineNumber: 21,
|
||||
ruleDescription: 'Multiple spaces inside hashes on closed atx style heading',
|
||||
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md021.md',
|
||||
ruleNames: [
|
||||
'MD021',
|
||||
'no-multiple-space-closed-atx',
|
||||
],
|
||||
},
|
||||
{
|
||||
errorContext: '# F #',
|
||||
errorDetail: null,
|
||||
errorRange: [
|
||||
6,
|
||||
1,
|
||||
],
|
||||
fixInfo: {
|
||||
deleteCount: 1,
|
||||
editColumn: 6,
|
||||
},
|
||||
lineNumber: 21,
|
||||
ruleDescription: 'Multiple spaces inside hashes on closed atx style heading',
|
||||
|
@ -46868,13 +46986,31 @@ Generated by [AVA](https://avajs.dev).
|
|||
errorContext: '## L ##',
|
||||
errorDetail: null,
|
||||
errorRange: [
|
||||
4,
|
||||
1,
|
||||
5,
|
||||
],
|
||||
fixInfo: {
|
||||
deleteCount: 9,
|
||||
editColumn: 1,
|
||||
insertText: '## L ##',
|
||||
deleteCount: 1,
|
||||
editColumn: 4,
|
||||
},
|
||||
lineNumber: 41,
|
||||
ruleDescription: 'Multiple spaces inside hashes on closed atx style heading',
|
||||
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md021.md',
|
||||
ruleNames: [
|
||||
'MD021',
|
||||
'no-multiple-space-closed-atx',
|
||||
],
|
||||
},
|
||||
{
|
||||
errorContext: '## L ##',
|
||||
errorDetail: null,
|
||||
errorRange: [
|
||||
7,
|
||||
1,
|
||||
],
|
||||
fixInfo: {
|
||||
deleteCount: 1,
|
||||
editColumn: 7,
|
||||
},
|
||||
lineNumber: 41,
|
||||
ruleDescription: 'Multiple spaces inside hashes on closed atx style heading',
|
||||
|
@ -46888,13 +47024,31 @@ Generated by [AVA](https://avajs.dev).
|
|||
errorContext: '# RR #',
|
||||
errorDetail: null,
|
||||
errorRange: [
|
||||
3,
|
||||
1,
|
||||
4,
|
||||
],
|
||||
fixInfo: {
|
||||
deleteCount: 8,
|
||||
editColumn: 1,
|
||||
insertText: '# RR #',
|
||||
deleteCount: 1,
|
||||
editColumn: 3,
|
||||
},
|
||||
lineNumber: 61,
|
||||
ruleDescription: 'Multiple spaces inside hashes on closed atx style heading',
|
||||
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md021.md',
|
||||
ruleNames: [
|
||||
'MD021',
|
||||
'no-multiple-space-closed-atx',
|
||||
],
|
||||
},
|
||||
{
|
||||
errorContext: '# RR #',
|
||||
errorDetail: null,
|
||||
errorRange: [
|
||||
7,
|
||||
1,
|
||||
],
|
||||
fixInfo: {
|
||||
deleteCount: 1,
|
||||
editColumn: 7,
|
||||
},
|
||||
lineNumber: 61,
|
||||
ruleDescription: 'Multiple spaces inside hashes on closed atx style heading',
|
||||
|
@ -46908,13 +47062,31 @@ Generated by [AVA](https://avajs.dev).
|
|||
errorContext: '## XX ##',
|
||||
errorDetail: null,
|
||||
errorRange: [
|
||||
4,
|
||||
1,
|
||||
5,
|
||||
],
|
||||
fixInfo: {
|
||||
deleteCount: 10,
|
||||
editColumn: 1,
|
||||
insertText: '## XX ##',
|
||||
deleteCount: 1,
|
||||
editColumn: 4,
|
||||
},
|
||||
lineNumber: 81,
|
||||
ruleDescription: 'Multiple spaces inside hashes on closed atx style heading',
|
||||
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md021.md',
|
||||
ruleNames: [
|
||||
'MD021',
|
||||
'no-multiple-space-closed-atx',
|
||||
],
|
||||
},
|
||||
{
|
||||
errorContext: '## XX ##',
|
||||
errorDetail: null,
|
||||
errorRange: [
|
||||
8,
|
||||
1,
|
||||
],
|
||||
fixInfo: {
|
||||
deleteCount: 1,
|
||||
editColumn: 8,
|
||||
},
|
||||
lineNumber: 81,
|
||||
ruleDescription: 'Multiple spaces inside hashes on closed atx style heading',
|
||||
|
|
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue