Reimplement MD003/heading-style using micromark tokens.

This commit is contained in:
David Anson 2024-06-08 14:44:49 -07:00
parent e447db33c9
commit 6daaa43410
10 changed files with 132 additions and 148 deletions

View file

@ -12,12 +12,13 @@
## Heading 7 {MD021} ##
## Heading 8 {MD003}\#
## Heading 8\#
## Heading 9 {MD003} \#
## Heading 9 \#
## Heading 10 {MD003} \#
## Heading 10 \#
<!-- markdownlint-configure-file {
"first-line-heading": false
"first-line-heading": false,
"heading-style": false
} -->

View file

@ -34,4 +34,4 @@ Text
</p>
<!-- markdownlint-disable-file MD013 MD033 -->
<!-- markdownlint-disable-file line-length no-inline-html -->

View file

@ -14,8 +14,8 @@
### Heading with trailing hash {MD003} ##
### Heading with trailing hash no space{MD003}{MD020}##
### Heading with trailing hash no space{MD020}##
### Heading with trailing hash {MD003}{MD020} \##
### Heading with trailing hash {MD020} \##
### Heading with trailing hash no space{MD003}{MD020}\##
### Heading with trailing hash no space{MD020}\##

View file

@ -2786,45 +2786,6 @@ Generated by [AVA](https://avajs.dev).
{
errors: [
{
errorContext: null,
errorDetail: 'Expected: atx_closed; Actual: atx',
errorRange: null,
fixInfo: null,
lineNumber: 15,
ruleDescription: 'Heading style',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md003.md',
ruleNames: [
'MD003',
'heading-style',
],
},
{
errorContext: null,
errorDetail: 'Expected: atx_closed; Actual: atx',
errorRange: null,
fixInfo: null,
lineNumber: 17,
ruleDescription: 'Heading style',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md003.md',
ruleNames: [
'MD003',
'heading-style',
],
},
{
errorContext: null,
errorDetail: 'Expected: atx_closed; Actual: atx',
errorRange: null,
fixInfo: null,
lineNumber: 19,
ruleDescription: 'Heading style',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md003.md',
ruleNames: [
'MD003',
'heading-style',
],
},
{
errorContext: '#Heading 1 {MD020} #',
errorDetail: null,
@ -2980,14 +2941,15 @@ Generated by [AVA](https://avajs.dev).
## Heading 7 {MD021} ##␊
## Heading 8 {MD003}\\#␊
## Heading 8\\#␊
## Heading 9 {MD003} \\#␊
## Heading 9 \\#␊
## Heading 10 {MD003} \\#␊
## Heading 10 \\#␊
<!-- markdownlint-configure-file {␊
"first-line-heading": false␊
"first-line-heading": false,␊
"heading-style": false␊
} -->␊
`,
}
@ -38202,7 +38164,7 @@ Generated by [AVA](https://avajs.dev).
</p>
<!-- markdownlint-disable-file MD013 MD033 -->
<!-- markdownlint-disable-file line-length no-inline-html -->
`,
}
@ -38250,55 +38212,16 @@ Generated by [AVA](https://avajs.dev).
],
},
{
errorContext: null,
errorDetail: 'Expected: atx; Actual: atx_closed',
errorRange: null,
fixInfo: null,
lineNumber: 17,
ruleDescription: 'Heading style',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md003.md',
ruleNames: [
'MD003',
'heading-style',
],
},
{
errorContext: null,
errorDetail: 'Expected: atx; Actual: atx_closed',
errorRange: null,
fixInfo: null,
lineNumber: 19,
ruleDescription: 'Heading style',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md003.md',
ruleNames: [
'MD003',
'heading-style',
],
},
{
errorContext: null,
errorDetail: 'Expected: atx; Actual: atx_closed',
errorRange: null,
fixInfo: null,
lineNumber: 21,
ruleDescription: 'Heading style',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md003.md',
ruleNames: [
'MD003',
'heading-style',
],
},
{
errorContext: '... hash no space{MD003}{MD020}##',
errorContext: '...railing hash no space{MD020}##',
errorDetail: null,
errorRange: [
53,
46,
3,
],
fixInfo: {
deleteCount: 55,
deleteCount: 48,
editColumn: 1,
insertText: '### Heading with trailing hash no space{MD003}{MD020} ##',
insertText: '### Heading with trailing hash no space{MD020} ##',
},
lineNumber: 17,
ruleDescription: 'No space inside hashes on closed atx style heading',
@ -38309,7 +38232,27 @@ Generated by [AVA](https://avajs.dev).
],
},
{
errorContext: '...ailing hash {MD003}{MD020} \\##',
errorContext: '...with trailing hash {MD020} \\##',
errorDetail: null,
errorRange: [
41,
2,
],
fixInfo: {
deleteCount: 42,
editColumn: 1,
insertText: '### Heading with trailing hash {MD020} \\# #',
},
lineNumber: 19,
ruleDescription: 'No space inside hashes on closed atx style heading',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md020.md',
ruleNames: [
'MD020',
'no-missing-space-closed-atx',
],
},
{
errorContext: '...ailing hash no space{MD020}\\##',
errorDetail: null,
errorRange: [
48,
@ -38318,27 +38261,7 @@ Generated by [AVA](https://avajs.dev).
fixInfo: {
deleteCount: 49,
editColumn: 1,
insertText: '### Heading with trailing hash {MD003}{MD020} \\# #',
},
lineNumber: 19,
ruleDescription: 'No space inside hashes on closed atx style heading',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md020.md',
ruleNames: [
'MD020',
'no-missing-space-closed-atx',
],
},
{
errorContext: '...hash no space{MD003}{MD020}\\##',
errorDetail: null,
errorRange: [
55,
2,
],
fixInfo: {
deleteCount: 56,
editColumn: 1,
insertText: '### Heading with trailing hash no space{MD003}{MD020} \\# #',
insertText: '### Heading with trailing hash no space{MD020} \\# #',
},
lineNumber: 21,
ruleDescription: 'No space inside hashes on closed atx style heading',
@ -38365,11 +38288,11 @@ Generated by [AVA](https://avajs.dev).
### Heading with trailing hash {MD003} ##␊
### Heading with trailing hash no space{MD003}{MD020} ##␊
### Heading with trailing hash no space{MD020} ##␊
### Heading with trailing hash {MD003}{MD020} \\# #␊
### Heading with trailing hash {MD020} \\# #␊
### Heading with trailing hash no space{MD003}{MD020} \\# #␊
### Heading with trailing hash no space{MD020} \\# #␊
`,
}