Add support for named heading fragments as supported by some platforms (fixes #830).

This commit is contained in:
David Anson 2023-07-08 22:14:00 -07:00
parent 3dcb66cac5
commit 7a794192ca
8 changed files with 295 additions and 18 deletions

View file

@ -23709,6 +23709,134 @@ Generated by [AVA](https://avajs.dev).
'link-fragments',
],
},
{
errorContext: '[Invalid](#embedded-space)',
errorDetail: null,
errorRange: [
1,
26,
],
fixInfo: null,
lineNumber: 207,
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](#embedded_space)',
errorDetail: null,
errorRange: [
1,
26,
],
fixInfo: null,
lineNumber: 209,
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](#embedded)',
errorDetail: null,
errorRange: [
1,
20,
],
fixInfo: null,
lineNumber: 211,
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](#hyphen--run)',
errorDetail: null,
errorRange: [
1,
23,
],
fixInfo: null,
lineNumber: 213,
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](#hyphen-run)',
errorDetail: null,
errorRange: [
1,
22,
],
fixInfo: null,
lineNumber: 215,
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](#named-fragment-outside-heading)',
errorDetail: null,
errorRange: [
1,
42,
],
fixInfo: null,
lineNumber: 217,
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](#UpperCase)',
errorDetail: null,
errorRange: [
1,
21,
],
fixInfo: null,
lineNumber: 219,
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](#uppercase)',
errorDetail: null,
errorRange: [
1,
21,
],
fixInfo: null,
lineNumber: 221,
ruleDescription: 'Link fragments should be valid',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md',
ruleNames: [
'MD051',
'link-fragments',
],
},
],
fixed: `# Valid/Invalid Link Fragments␊
@ -23883,6 +24011,55 @@ Generated by [AVA](https://avajs.dev).
[mixedref]: #idLINK
## Valid Named Fragments␊
[Valid](#named-fragment)␊
[Valid](#valid-heading-with-named-fragment-named-fragment)␊
[Valid](#another_fragment_123)␊
[Valid](#valid-heading-with-another-named-fragment-another_fragment_123)␊
[Valid](#closed-atx)␊
[Valid](#setext)␊
### Valid Heading with Named Fragment {#named-fragment}␊
### Valid Heading with Another Named Fragment {#another_fragment_123}␊
### Valid Closed ATX Heading with Named Fragment {#closed-atx} ###␊
Valid Setext Heading with Named Fragment {#setext}␊
--------------------------------------------------␊
## Invalid Named Fragments␊
### Invalid Heading with Named Fragment {#embedded space}␊
### Invalid Heading with Named Fragment {#hyphen--run}␊
### Invalid Heading with Named Fragment {#UpperCase}␊
{#named-fragment-outside-heading}␊
[Invalid](#embedded-space) {MD051}␊
[Invalid](#embedded_space) {MD051}␊
[Invalid](#embedded) {MD051}␊
[Invalid](#hyphen--run) {MD051}␊
[Invalid](#hyphen-run) {MD051}␊
[Invalid](#named-fragment-outside-heading) {MD051}␊
[Invalid](#UpperCase) {MD051}␊
[Invalid](#uppercase) {MD051}␊
<!-- markdownlint-configure-file {␊
"emphasis-style": false,␊
"heading-style": false,␊