mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2026-01-04 15:08:49 +01:00
Update MD051/link-fragments to add ignore_case parameter and improve documentation (fixes #1274).
This commit is contained in:
parent
74aa96d19d
commit
04c693b00b
16 changed files with 315 additions and 44 deletions
23
test/link-fragments-default-case.md
Normal file
23
test/link-fragments-default-case.md
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
# Link Fragments Default Case
|
||||
|
||||
## Heading Name
|
||||
|
||||
[Valid](#heading-name)
|
||||
|
||||
[Invalid](#Heading-Name) {MD051}
|
||||
|
||||
## Valid *Heading* With _Emphasis_
|
||||
|
||||
[Valid](#valid-heading-with-emphasis)
|
||||
|
||||
[Invalid](#Valid-Heading-With-Emphasis) {MD051}
|
||||
|
||||
## 🚀 Valid Heading With Emoji
|
||||
|
||||
[Valid](#-valid-heading-with-emoji)
|
||||
|
||||
[Invalid](#-Valid-Heading-With-Emoji) {MD051}
|
||||
|
||||
<!-- markdownlint-configure-file {
|
||||
"emphasis-style": false
|
||||
} -->
|
||||
26
test/link-fragments-ignore-case.md
Normal file
26
test/link-fragments-ignore-case.md
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
# Link Fragments Ignore Case
|
||||
|
||||
## Heading Name
|
||||
|
||||
[Valid](#heading-name)
|
||||
|
||||
[Valid](#Heading-Name)
|
||||
|
||||
## Valid *Heading* With _Emphasis_
|
||||
|
||||
[Valid](#valid-heading-with-emphasis)
|
||||
|
||||
[Valid](#Valid-Heading-With-Emphasis)
|
||||
|
||||
## 🚀 Valid Heading With Emoji
|
||||
|
||||
[Valid](#-valid-heading-with-emoji)
|
||||
|
||||
[Valid](#-Valid-Heading-With-Emoji)
|
||||
|
||||
<!-- markdownlint-configure-file {
|
||||
"emphasis-style": false,
|
||||
"link-fragments": {
|
||||
"ignore_case": true
|
||||
}
|
||||
} -->
|
||||
|
|
@ -941,7 +941,7 @@ test("readme", async(t) => {
|
|||
});
|
||||
|
||||
test("validateJsonUsingConfigSchemaStrict", async(t) => {
|
||||
t.plan(179);
|
||||
t.plan(181);
|
||||
// @ts-ignore
|
||||
const ajv = new Ajv(ajvOptions);
|
||||
const validateSchemaStrict = ajv.compile(configSchemaStrict);
|
||||
|
|
|
|||
|
|
@ -24546,6 +24546,134 @@ Generated by [AVA](https://avajs.dev).
|
|||
`,
|
||||
}
|
||||
|
||||
## link-fragments-default-case.md
|
||||
|
||||
> Snapshot 1
|
||||
|
||||
{
|
||||
errors: [
|
||||
{
|
||||
errorContext: '[Invalid](#Heading-Name)',
|
||||
errorDetail: 'Expected: #heading-name; Actual: #Heading-Name',
|
||||
errorRange: [
|
||||
1,
|
||||
24,
|
||||
],
|
||||
fixInfo: {
|
||||
deleteCount: 13,
|
||||
editColumn: 11,
|
||||
insertText: '#heading-name',
|
||||
},
|
||||
lineNumber: 7,
|
||||
ruleDescription: 'Link fragments should be valid',
|
||||
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md',
|
||||
ruleNames: [
|
||||
'MD051',
|
||||
'link-fragments',
|
||||
],
|
||||
},
|
||||
{
|
||||
errorContext: '[Invalid](#Valid-Heading-With-Emphasis)',
|
||||
errorDetail: 'Expected: #valid-heading-with-emphasis; Actual: #Valid-Heading-With-Emphasis',
|
||||
errorRange: [
|
||||
1,
|
||||
39,
|
||||
],
|
||||
fixInfo: {
|
||||
deleteCount: 28,
|
||||
editColumn: 11,
|
||||
insertText: '#valid-heading-with-emphasis',
|
||||
},
|
||||
lineNumber: 13,
|
||||
ruleDescription: 'Link fragments should be valid',
|
||||
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md',
|
||||
ruleNames: [
|
||||
'MD051',
|
||||
'link-fragments',
|
||||
],
|
||||
},
|
||||
{
|
||||
errorContext: '[Invalid](#-Valid-Heading-With-Emoji)',
|
||||
errorDetail: 'Expected: #-valid-heading-with-emoji; Actual: #-Valid-Heading-With-Emoji',
|
||||
errorRange: [
|
||||
1,
|
||||
37,
|
||||
],
|
||||
fixInfo: {
|
||||
deleteCount: 26,
|
||||
editColumn: 11,
|
||||
insertText: '#-valid-heading-with-emoji',
|
||||
},
|
||||
lineNumber: 19,
|
||||
ruleDescription: 'Link fragments should be valid',
|
||||
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md',
|
||||
ruleNames: [
|
||||
'MD051',
|
||||
'link-fragments',
|
||||
],
|
||||
},
|
||||
],
|
||||
fixed: `# Link Fragments Default Case␊
|
||||
␊
|
||||
## Heading Name␊
|
||||
␊
|
||||
[Valid](#heading-name)␊
|
||||
␊
|
||||
[Invalid](#heading-name) {MD051}␊
|
||||
␊
|
||||
## Valid *Heading* With _Emphasis_␊
|
||||
␊
|
||||
[Valid](#valid-heading-with-emphasis)␊
|
||||
␊
|
||||
[Invalid](#valid-heading-with-emphasis) {MD051}␊
|
||||
␊
|
||||
## 🚀 Valid Heading With Emoji␊
|
||||
␊
|
||||
[Valid](#-valid-heading-with-emoji)␊
|
||||
␊
|
||||
[Invalid](#-valid-heading-with-emoji) {MD051}␊
|
||||
␊
|
||||
<!-- markdownlint-configure-file {␊
|
||||
"emphasis-style": false␊
|
||||
} -->␊
|
||||
`,
|
||||
}
|
||||
|
||||
## link-fragments-ignore-case.md
|
||||
|
||||
> Snapshot 1
|
||||
|
||||
{
|
||||
errors: [],
|
||||
fixed: `# Link Fragments Ignore Case␊
|
||||
␊
|
||||
## Heading Name␊
|
||||
␊
|
||||
[Valid](#heading-name)␊
|
||||
␊
|
||||
[Valid](#Heading-Name)␊
|
||||
␊
|
||||
## Valid *Heading* With _Emphasis_␊
|
||||
␊
|
||||
[Valid](#valid-heading-with-emphasis)␊
|
||||
␊
|
||||
[Valid](#Valid-Heading-With-Emphasis)␊
|
||||
␊
|
||||
## 🚀 Valid Heading With Emoji␊
|
||||
␊
|
||||
[Valid](#-valid-heading-with-emoji)␊
|
||||
␊
|
||||
[Valid](#-Valid-Heading-With-Emoji)␊
|
||||
␊
|
||||
<!-- markdownlint-configure-file {␊
|
||||
"emphasis-style": false,␊
|
||||
"link-fragments": {␊
|
||||
"ignore_case": true␊
|
||||
}␊
|
||||
} -->␊
|
||||
`,
|
||||
}
|
||||
|
||||
## link-fragments.md
|
||||
|
||||
> Snapshot 1
|
||||
|
|
|
|||
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue