mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-16 14:00:13 +01:00
Reimplement MD035/hr-style using micromark tokens (fixes #736).
This commit is contained in:
parent
f1e33672ba
commit
8057f3d37e
7 changed files with 508 additions and 25 deletions
31
test/hr-in-list-dash.md
Normal file
31
test/hr-in-list-dash.md
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
# HR in List, Dash
|
||||
|
||||
---
|
||||
|
||||
***
|
||||
|
||||
___
|
||||
|
||||
{MD035:5} {MD035:7}
|
||||
|
||||
<!-- markdownlint-disable blanks-around-lists ul-style -->
|
||||
|
||||
- list
|
||||
- ---
|
||||
- list
|
||||
- ***
|
||||
- list
|
||||
- ___
|
||||
- list
|
||||
|
||||
{MD035:14} {MD035:16} {MD035:18}
|
||||
|
||||
* list
|
||||
* ---
|
||||
* list
|
||||
* ***
|
||||
* list
|
||||
* ___
|
||||
* list
|
||||
|
||||
{MD035:26} {MD035:28}
|
||||
31
test/hr-in-list-star.md
Normal file
31
test/hr-in-list-star.md
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
# HR in List, Star
|
||||
|
||||
***
|
||||
|
||||
___
|
||||
|
||||
---
|
||||
|
||||
{MD035:5} {MD035:7}
|
||||
|
||||
<!-- markdownlint-disable blanks-around-lists ul-style -->
|
||||
|
||||
- list
|
||||
- ---
|
||||
- list
|
||||
- ***
|
||||
- list
|
||||
- ___
|
||||
- list
|
||||
|
||||
{MD035:14} {MD035:18}
|
||||
|
||||
* list
|
||||
* ---
|
||||
* list
|
||||
* ***
|
||||
* list
|
||||
* ___
|
||||
* list
|
||||
|
||||
{MD035:24} {MD035:26} {MD035:28}
|
||||
31
test/hr-in-list-under.md
Normal file
31
test/hr-in-list-under.md
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
# HR in List, Under
|
||||
|
||||
___
|
||||
|
||||
---
|
||||
|
||||
***
|
||||
|
||||
{MD035:5} {MD035:7}
|
||||
|
||||
<!-- markdownlint-disable blanks-around-lists ul-style -->
|
||||
|
||||
- list
|
||||
- ---
|
||||
- list
|
||||
- ***
|
||||
- list
|
||||
- ___
|
||||
- list
|
||||
|
||||
{MD035:14} {MD035:16}
|
||||
|
||||
* list
|
||||
* ---
|
||||
* list
|
||||
* ***
|
||||
* list
|
||||
* ___
|
||||
* list
|
||||
|
||||
{MD035:24} {MD035:26}
|
||||
|
|
@ -15312,6 +15312,389 @@ Generated by [AVA](https://avajs.dev).
|
|||
`,
|
||||
}
|
||||
|
||||
## hr-in-list-dash.md
|
||||
|
||||
> Snapshot 1
|
||||
|
||||
{
|
||||
errors: [
|
||||
{
|
||||
errorContext: null,
|
||||
errorDetail: 'Expected: ---; Actual: ***',
|
||||
errorRange: null,
|
||||
fixInfo: null,
|
||||
lineNumber: 5,
|
||||
ruleDescription: 'Horizontal rule style',
|
||||
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md',
|
||||
ruleNames: [
|
||||
'MD035',
|
||||
'hr-style',
|
||||
],
|
||||
},
|
||||
{
|
||||
errorContext: null,
|
||||
errorDetail: 'Expected: ---; Actual: ___',
|
||||
errorRange: null,
|
||||
fixInfo: null,
|
||||
lineNumber: 7,
|
||||
ruleDescription: 'Horizontal rule style',
|
||||
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md',
|
||||
ruleNames: [
|
||||
'MD035',
|
||||
'hr-style',
|
||||
],
|
||||
},
|
||||
{
|
||||
errorContext: null,
|
||||
errorDetail: 'Expected: ---; Actual: - ---',
|
||||
errorRange: null,
|
||||
fixInfo: null,
|
||||
lineNumber: 14,
|
||||
ruleDescription: 'Horizontal rule style',
|
||||
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md',
|
||||
ruleNames: [
|
||||
'MD035',
|
||||
'hr-style',
|
||||
],
|
||||
},
|
||||
{
|
||||
errorContext: null,
|
||||
errorDetail: 'Expected: ---; Actual: ***',
|
||||
errorRange: null,
|
||||
fixInfo: null,
|
||||
lineNumber: 16,
|
||||
ruleDescription: 'Horizontal rule style',
|
||||
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md',
|
||||
ruleNames: [
|
||||
'MD035',
|
||||
'hr-style',
|
||||
],
|
||||
},
|
||||
{
|
||||
errorContext: null,
|
||||
errorDetail: 'Expected: ---; Actual: ___',
|
||||
errorRange: null,
|
||||
fixInfo: null,
|
||||
lineNumber: 18,
|
||||
ruleDescription: 'Horizontal rule style',
|
||||
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md',
|
||||
ruleNames: [
|
||||
'MD035',
|
||||
'hr-style',
|
||||
],
|
||||
},
|
||||
{
|
||||
errorContext: null,
|
||||
errorDetail: 'Expected: ---; Actual: * ***',
|
||||
errorRange: null,
|
||||
fixInfo: null,
|
||||
lineNumber: 26,
|
||||
ruleDescription: 'Horizontal rule style',
|
||||
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md',
|
||||
ruleNames: [
|
||||
'MD035',
|
||||
'hr-style',
|
||||
],
|
||||
},
|
||||
{
|
||||
errorContext: null,
|
||||
errorDetail: 'Expected: ---; Actual: ___',
|
||||
errorRange: null,
|
||||
fixInfo: null,
|
||||
lineNumber: 28,
|
||||
ruleDescription: 'Horizontal rule style',
|
||||
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md',
|
||||
ruleNames: [
|
||||
'MD035',
|
||||
'hr-style',
|
||||
],
|
||||
},
|
||||
],
|
||||
fixed: `# HR in List, Dash␊
|
||||
␊
|
||||
---␊
|
||||
␊
|
||||
***␊
|
||||
␊
|
||||
___␊
|
||||
␊
|
||||
{MD035:5} {MD035:7}␊
|
||||
␊
|
||||
<!-- markdownlint-disable blanks-around-lists ul-style -->␊
|
||||
␊
|
||||
- list␊
|
||||
- ---␊
|
||||
- list␊
|
||||
- ***␊
|
||||
- list␊
|
||||
- ___␊
|
||||
- list␊
|
||||
␊
|
||||
{MD035:14} {MD035:16} {MD035:18}␊
|
||||
␊
|
||||
* list␊
|
||||
* ---␊
|
||||
* list␊
|
||||
* ***␊
|
||||
* list␊
|
||||
* ___␊
|
||||
* list␊
|
||||
␊
|
||||
{MD035:26} {MD035:28}␊
|
||||
`,
|
||||
}
|
||||
|
||||
## hr-in-list-star.md
|
||||
|
||||
> Snapshot 1
|
||||
|
||||
{
|
||||
errors: [
|
||||
{
|
||||
errorContext: null,
|
||||
errorDetail: 'Expected: ***; Actual: ___',
|
||||
errorRange: null,
|
||||
fixInfo: null,
|
||||
lineNumber: 5,
|
||||
ruleDescription: 'Horizontal rule style',
|
||||
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md',
|
||||
ruleNames: [
|
||||
'MD035',
|
||||
'hr-style',
|
||||
],
|
||||
},
|
||||
{
|
||||
errorContext: null,
|
||||
errorDetail: 'Expected: ***; Actual: ---',
|
||||
errorRange: null,
|
||||
fixInfo: null,
|
||||
lineNumber: 7,
|
||||
ruleDescription: 'Horizontal rule style',
|
||||
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md',
|
||||
ruleNames: [
|
||||
'MD035',
|
||||
'hr-style',
|
||||
],
|
||||
},
|
||||
{
|
||||
errorContext: null,
|
||||
errorDetail: 'Expected: ***; Actual: - ---',
|
||||
errorRange: null,
|
||||
fixInfo: null,
|
||||
lineNumber: 14,
|
||||
ruleDescription: 'Horizontal rule style',
|
||||
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md',
|
||||
ruleNames: [
|
||||
'MD035',
|
||||
'hr-style',
|
||||
],
|
||||
},
|
||||
{
|
||||
errorContext: null,
|
||||
errorDetail: 'Expected: ***; Actual: ___',
|
||||
errorRange: null,
|
||||
fixInfo: null,
|
||||
lineNumber: 18,
|
||||
ruleDescription: 'Horizontal rule style',
|
||||
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md',
|
||||
ruleNames: [
|
||||
'MD035',
|
||||
'hr-style',
|
||||
],
|
||||
},
|
||||
{
|
||||
errorContext: null,
|
||||
errorDetail: 'Expected: ***; Actual: ---',
|
||||
errorRange: null,
|
||||
fixInfo: null,
|
||||
lineNumber: 24,
|
||||
ruleDescription: 'Horizontal rule style',
|
||||
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md',
|
||||
ruleNames: [
|
||||
'MD035',
|
||||
'hr-style',
|
||||
],
|
||||
},
|
||||
{
|
||||
errorContext: null,
|
||||
errorDetail: 'Expected: ***; Actual: * ***',
|
||||
errorRange: null,
|
||||
fixInfo: null,
|
||||
lineNumber: 26,
|
||||
ruleDescription: 'Horizontal rule style',
|
||||
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md',
|
||||
ruleNames: [
|
||||
'MD035',
|
||||
'hr-style',
|
||||
],
|
||||
},
|
||||
{
|
||||
errorContext: null,
|
||||
errorDetail: 'Expected: ***; Actual: ___',
|
||||
errorRange: null,
|
||||
fixInfo: null,
|
||||
lineNumber: 28,
|
||||
ruleDescription: 'Horizontal rule style',
|
||||
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md',
|
||||
ruleNames: [
|
||||
'MD035',
|
||||
'hr-style',
|
||||
],
|
||||
},
|
||||
],
|
||||
fixed: `# HR in List, Star␊
|
||||
␊
|
||||
***␊
|
||||
␊
|
||||
___␊
|
||||
␊
|
||||
---␊
|
||||
␊
|
||||
{MD035:5} {MD035:7}␊
|
||||
␊
|
||||
<!-- markdownlint-disable blanks-around-lists ul-style -->␊
|
||||
␊
|
||||
- list␊
|
||||
- ---␊
|
||||
- list␊
|
||||
- ***␊
|
||||
- list␊
|
||||
- ___␊
|
||||
- list␊
|
||||
␊
|
||||
{MD035:14} {MD035:18}␊
|
||||
␊
|
||||
* list␊
|
||||
* ---␊
|
||||
* list␊
|
||||
* ***␊
|
||||
* list␊
|
||||
* ___␊
|
||||
* list␊
|
||||
␊
|
||||
{MD035:24} {MD035:26} {MD035:28}␊
|
||||
`,
|
||||
}
|
||||
|
||||
## hr-in-list-under.md
|
||||
|
||||
> Snapshot 1
|
||||
|
||||
{
|
||||
errors: [
|
||||
{
|
||||
errorContext: null,
|
||||
errorDetail: 'Expected: ___; Actual: ---',
|
||||
errorRange: null,
|
||||
fixInfo: null,
|
||||
lineNumber: 5,
|
||||
ruleDescription: 'Horizontal rule style',
|
||||
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md',
|
||||
ruleNames: [
|
||||
'MD035',
|
||||
'hr-style',
|
||||
],
|
||||
},
|
||||
{
|
||||
errorContext: null,
|
||||
errorDetail: 'Expected: ___; Actual: ***',
|
||||
errorRange: null,
|
||||
fixInfo: null,
|
||||
lineNumber: 7,
|
||||
ruleDescription: 'Horizontal rule style',
|
||||
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md',
|
||||
ruleNames: [
|
||||
'MD035',
|
||||
'hr-style',
|
||||
],
|
||||
},
|
||||
{
|
||||
errorContext: null,
|
||||
errorDetail: 'Expected: ___; Actual: - ---',
|
||||
errorRange: null,
|
||||
fixInfo: null,
|
||||
lineNumber: 14,
|
||||
ruleDescription: 'Horizontal rule style',
|
||||
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md',
|
||||
ruleNames: [
|
||||
'MD035',
|
||||
'hr-style',
|
||||
],
|
||||
},
|
||||
{
|
||||
errorContext: null,
|
||||
errorDetail: 'Expected: ___; Actual: ***',
|
||||
errorRange: null,
|
||||
fixInfo: null,
|
||||
lineNumber: 16,
|
||||
ruleDescription: 'Horizontal rule style',
|
||||
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md',
|
||||
ruleNames: [
|
||||
'MD035',
|
||||
'hr-style',
|
||||
],
|
||||
},
|
||||
{
|
||||
errorContext: null,
|
||||
errorDetail: 'Expected: ___; Actual: ---',
|
||||
errorRange: null,
|
||||
fixInfo: null,
|
||||
lineNumber: 24,
|
||||
ruleDescription: 'Horizontal rule style',
|
||||
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md',
|
||||
ruleNames: [
|
||||
'MD035',
|
||||
'hr-style',
|
||||
],
|
||||
},
|
||||
{
|
||||
errorContext: null,
|
||||
errorDetail: 'Expected: ___; Actual: * ***',
|
||||
errorRange: null,
|
||||
fixInfo: null,
|
||||
lineNumber: 26,
|
||||
ruleDescription: 'Horizontal rule style',
|
||||
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md035.md',
|
||||
ruleNames: [
|
||||
'MD035',
|
||||
'hr-style',
|
||||
],
|
||||
},
|
||||
],
|
||||
fixed: `# HR in List, Under␊
|
||||
␊
|
||||
___␊
|
||||
␊
|
||||
---␊
|
||||
␊
|
||||
***␊
|
||||
␊
|
||||
{MD035:5} {MD035:7}␊
|
||||
␊
|
||||
<!-- markdownlint-disable blanks-around-lists ul-style -->␊
|
||||
␊
|
||||
- list␊
|
||||
- ---␊
|
||||
- list␊
|
||||
- ***␊
|
||||
- list␊
|
||||
- ___␊
|
||||
- list␊
|
||||
␊
|
||||
{MD035:14} {MD035:16}␊
|
||||
␊
|
||||
* list␊
|
||||
* ---␊
|
||||
* list␊
|
||||
* ***␊
|
||||
* list␊
|
||||
* ___␊
|
||||
* list␊
|
||||
␊
|
||||
{MD035:24} {MD035:26}␊
|
||||
`,
|
||||
}
|
||||
|
||||
## hr-style-custom.md
|
||||
|
||||
> Snapshot 1
|
||||
|
|
|
|||
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue