Reimplement MD023/heading-start-left using micromark tokens.

This commit is contained in:
David Anson 2024-06-17 22:18:58 -07:00
parent 26a0084515
commit 3b9a7fb2dd
5 changed files with 70 additions and 85 deletions

View file

@ -16,7 +16,7 @@ Some text
```
* This is another case where MD023 shouldn't be triggered
# Test {MD022} {MD023} Valid heading for CommonMark (see section 5.2)
# Test {MD022} Valid heading for CommonMark (see section 5.2)
# Test {MD022} {MD023} Also valid heading for CommonMark
<!-- markdownlint-configure-file {

View file

@ -623,7 +623,7 @@ Generated by [AVA](https://avajs.dev).
errorDetail: null,
errorRange: [
1,
2,
1,
],
fixInfo: {
deleteCount: 1,
@ -5602,12 +5602,12 @@ Generated by [AVA](https://avajs.dev).
errorContext: '> ## Quoted indented sub-head...',
errorDetail: null,
errorRange: [
3,
1,
4,
],
fixInfo: {
deleteCount: 3,
editColumn: 2,
deleteCount: 1,
editColumn: 3,
},
lineNumber: 17,
ruleDescription: 'Headings must start at the beginning of the line',
@ -5621,12 +5621,12 @@ Generated by [AVA](https://avajs.dev).
errorContext: ' > ## Quoted indented sub-he...',
errorDetail: null,
errorRange: [
5,
1,
6,
],
fixInfo: {
deleteCount: 3,
editColumn: 4,
deleteCount: 1,
editColumn: 5,
},
lineNumber: 33,
ruleDescription: 'Headings must start at the beginning of the line',
@ -7141,7 +7141,7 @@ Generated by [AVA](https://avajs.dev).
errorDetail: null,
errorRange: [
1,
2,
1,
],
fixInfo: {
deleteCount: 1,
@ -16650,7 +16650,7 @@ Generated by [AVA](https://avajs.dev).
{
errors: [
{
errorContext: '# Test {MD022} {MD023} Valid heading for CommonMark (see section 5.2)',
errorContext: '# Test {MD022} Valid heading for CommonMark (see section 5.2)',
errorDetail: 'Expected: 1; Actual: 0; Above',
errorRange: null,
fixInfo: {
@ -16666,7 +16666,7 @@ Generated by [AVA](https://avajs.dev).
],
},
{
errorContext: '# Test {MD022} {MD023} Valid heading for CommonMark (see section 5.2)',
errorContext: '# Test {MD022} Valid heading for CommonMark (see section 5.2)',
errorDetail: 'Expected: 1; Actual: 0; Below',
errorRange: null,
fixInfo: {
@ -16703,7 +16703,7 @@ Generated by [AVA](https://avajs.dev).
errorDetail: null,
errorRange: [
1,
2,
1,
],
fixInfo: {
deleteCount: 1,
@ -16722,7 +16722,7 @@ Generated by [AVA](https://avajs.dev).
errorDetail: null,
errorRange: [
1,
2,
1,
],
fixInfo: {
deleteCount: 1,
@ -16741,7 +16741,7 @@ Generated by [AVA](https://avajs.dev).
errorDetail: null,
errorRange: [
1,
2,
1,
],
fixInfo: {
deleteCount: 1,
@ -16755,35 +16755,16 @@ Generated by [AVA](https://avajs.dev).
'heading-start-left',
],
},
{
errorContext: ' # Test {MD022} {MD023} Valid...',
errorDetail: null,
errorRange: [
1,
3,
],
fixInfo: {
deleteCount: 2,
editColumn: 1,
},
lineNumber: 19,
ruleDescription: 'Headings must start at the beginning of the line',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md023.md',
ruleNames: [
'MD023',
'heading-start-left',
],
},
{
errorContext: ' # Test {MD022} {MD023} Als...',
errorDetail: null,
errorRange: [
1,
5,
3,
2,
],
fixInfo: {
deleteCount: 4,
editColumn: 1,
deleteCount: 2,
editColumn: 3,
},
lineNumber: 20,
ruleDescription: 'Headings must start at the beginning of the line',
@ -16813,9 +16794,9 @@ Generated by [AVA](https://avajs.dev).
* This is another case where MD023 shouldn't be triggered␊
# Test {MD022} {MD023} Valid heading for CommonMark (see section 5.2)␊
# Test {MD022} Valid heading for CommonMark (see section 5.2)␊
# Test {MD022} {MD023} Also valid heading for CommonMark␊
# Test {MD022} {MD023} Also valid heading for CommonMark␊
<!-- markdownlint-configure-file {␊
"heading-style": false,␊