Refine previous commit for MD051/link-fragments to tweak behavior, tests, and documentation.

This commit is contained in:
David Anson 2024-02-10 15:36:12 -08:00
parent 242b35f98f
commit 45c8766eda
8 changed files with 259 additions and 148 deletions

View file

@ -5383,6 +5383,7 @@ const {
const idRe = getHtmlAttributeRe("id"); const idRe = getHtmlAttributeRe("id");
const nameRe = getHtmlAttributeRe("name"); const nameRe = getHtmlAttributeRe("name");
const anchorRe = /\{(#[a-z\d]+(?:[-_][a-z\d]+)*)\}/gu; const anchorRe = /\{(#[a-z\d]+(?:[-_][a-z\d]+)*)\}/gu;
const lineFragmentRe = /^#(?:L\d+(?:C\d+)?-L\d+(?:C\d+)?|L\d+)$/;
// Sets for filtering heading tokens during conversion // Sets for filtering heading tokens during conversion
const childrenExclude = new Set(["image", "reference", "resource"]); const childrenExclude = new Set(["image", "reference", "resource"]);
@ -5471,7 +5472,6 @@ module.exports = {
} = definition; } = definition;
const text = unescapeStringTokenText(definition); const text = unescapeStringTokenText(definition);
const encodedText = `#${encodeURIComponent(text.slice(1))}`; const encodedText = `#${encodeURIComponent(text.slice(1))}`;
const lineFragmentRe = /^#L\d+(?:C\d+)?(?:-L\d+(?:C\d+)?)?$/;
if (text.length > 1 && text.startsWith("#") && !fragments.has(encodedText) && !lineFragmentRe.test(encodedText)) { if (text.length > 1 && text.startsWith("#") && !fragments.has(encodedText) && !lineFragmentRe.test(encodedText)) {
// eslint-disable-next-line no-undef-init // eslint-disable-next-line no-undef-init
let context = undefined; let context = undefined;

View file

@ -16,9 +16,9 @@ generated name (see below):
[Link](#heading-name) [Link](#heading-name)
``` ```
Furthermore, this rule mandates the use of lowercase for link fragments. Link fragments may be handled case-sensitively, so this rule requires fragments
Thus, even though the link points to the correct fragment, the following example to exactly match the [GitHub heading algorithm][github-heading-algorithm].
will still trigger this rule: Therefore, the following example is reported as a violation:
```markdown ```markdown
# Heading Name # Heading Name
@ -48,28 +48,21 @@ attribute can be used to define a fragment:
An `a` tag can be useful in scenarios where a heading is not appropriate or for An `a` tag can be useful in scenarios where a heading is not appropriate or for
control over the text of the fragment identifier. control over the text of the fragment identifier.
GitHub supports links to [specific lines][github-lines-links]. This rule also recognizes the custom fragment syntax used by GitHub to highlight
[specific content in a document][github-linking-to-content].
For example, to link to line 12 of current Markdown file: For example, this link to line 20:
```markdown ```markdown
[Go to line 12](#L12) [Link](#L20)
``` ```
GitHub also allows to specify a column number: And this link to content starting within line 19 running into line 21:
```markdown ```markdown
[Go to line 12, column 34](#L12-L34) [Link](#L19C5-L21C11)
``` ```
Or a range of lines/columns:
```markdown
[Go to lines 12-34](#L12-L34)
```
So this rule will not report violations when this syntax is used.
Rationale: [GitHub section links][github-section-links] are created Rationale: [GitHub section links][github-section-links] are created
automatically for every heading when Markdown content is displayed on GitHub. automatically for every heading when Markdown content is displayed on GitHub.
This makes it easy to link directly to different sections within a document. This makes it easy to link directly to different sections within a document.
@ -83,4 +76,4 @@ append an incrementing integer as needed for uniqueness.
[github-section-links]: https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#section-links [github-section-links]: https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#section-links
[github-heading-algorithm]: https://github.com/gjtorikian/html-pipeline/blob/f13a1534cb650ba17af400d1acd3a22c28004c09/lib/html/pipeline/toc_filter.rb [github-heading-algorithm]: https://github.com/gjtorikian/html-pipeline/blob/f13a1534cb650ba17af400d1acd3a22c28004c09/lib/html/pipeline/toc_filter.rb
[github-lines-links]: https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/creating-a-permanent-link-to-a-code-snippet#linking-to-markdown#linking-to-markdown [github-linking-to-content]: https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/creating-a-permanent-link-to-a-code-snippet#linking-to-markdown#linking-to-markdown

View file

@ -2100,9 +2100,9 @@ generated name (see below):
[Link](#heading-name) [Link](#heading-name)
``` ```
Furthermore, this rule mandates the use of lowercase for link fragments. Link fragments may be handled case-sensitively, so this rule requires fragments
Thus, even though the link points to the correct fragment, the following example to exactly match the [GitHub heading algorithm][github-heading-algorithm].
will still trigger this rule: Therefore, the following example is reported as a violation:
```markdown ```markdown
# Heading Name # Heading Name
@ -2132,28 +2132,21 @@ attribute can be used to define a fragment:
An `a` tag can be useful in scenarios where a heading is not appropriate or for An `a` tag can be useful in scenarios where a heading is not appropriate or for
control over the text of the fragment identifier. control over the text of the fragment identifier.
GitHub supports links to [specific lines][github-lines-links]. This rule also recognizes the custom fragment syntax used by GitHub to highlight
[specific content in a document][github-linking-to-content].
For example, to link to line 12 of current Markdown file: For example, this link to line 20:
```markdown ```markdown
[Go to line 12](#L12) [Link](#L20)
``` ```
GitHub also allows to specify a column number: And this link to content starting within line 19 running into line 21:
```markdown ```markdown
[Go to line 12, column 34](#L12-L34) [Link](#L19C5-L21C11)
``` ```
Or a range of lines/columns:
```markdown
[Go to lines 12-34](#L12-L34)
```
So this rule will not report violations when this syntax is used.
Rationale: [GitHub section links][github-section-links] are created Rationale: [GitHub section links][github-section-links] are created
automatically for every heading when Markdown content is displayed on GitHub. automatically for every heading when Markdown content is displayed on GitHub.
This makes it easy to link directly to different sections within a document. This makes it easy to link directly to different sections within a document.
@ -2167,7 +2160,7 @@ append an incrementing integer as needed for uniqueness.
[github-section-links]: https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#section-links [github-section-links]: https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#section-links
[github-heading-algorithm]: https://github.com/gjtorikian/html-pipeline/blob/f13a1534cb650ba17af400d1acd3a22c28004c09/lib/html/pipeline/toc_filter.rb [github-heading-algorithm]: https://github.com/gjtorikian/html-pipeline/blob/f13a1534cb650ba17af400d1acd3a22c28004c09/lib/html/pipeline/toc_filter.rb
[github-lines-links]: https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/creating-a-permanent-link-to-a-code-snippet#linking-to-markdown#linking-to-markdown [github-linking-to-content]: https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/creating-a-permanent-link-to-a-code-snippet#linking-to-markdown#linking-to-markdown
<a name="md052"></a> <a name="md052"></a>

View file

@ -24,9 +24,9 @@ generated name (see below):
[Link](#heading-name) [Link](#heading-name)
``` ```
Furthermore, this rule mandates the use of lowercase for link fragments. Link fragments may be handled case-sensitively, so this rule requires fragments
Thus, even though the link points to the correct fragment, the following example to exactly match the [GitHub heading algorithm][github-heading-algorithm].
will still trigger this rule: Therefore, the following example is reported as a violation:
```markdown ```markdown
# Heading Name # Heading Name
@ -56,28 +56,21 @@ attribute can be used to define a fragment:
An `a` tag can be useful in scenarios where a heading is not appropriate or for An `a` tag can be useful in scenarios where a heading is not appropriate or for
control over the text of the fragment identifier. control over the text of the fragment identifier.
GitHub supports links to [specific lines][github-lines-links]. This rule also recognizes the custom fragment syntax used by GitHub to highlight
[specific content in a document][github-linking-to-content].
For example, to link to line 12 of current Markdown file: For example, this link to line 20:
```markdown ```markdown
[Go to line 12](#L12) [Link](#L20)
``` ```
GitHub also allows to specify a column number: And this link to content starting within line 19 running into line 21:
```markdown ```markdown
[Go to line 12, column 34](#L12-L34) [Link](#L19C5-L21C11)
``` ```
Or a range of lines/columns:
```markdown
[Go to lines 12-34](#L12-L34)
```
So this rule will not report violations when this syntax is used.
Rationale: [GitHub section links][github-section-links] are created Rationale: [GitHub section links][github-section-links] are created
automatically for every heading when Markdown content is displayed on GitHub. automatically for every heading when Markdown content is displayed on GitHub.
This makes it easy to link directly to different sections within a document. This makes it easy to link directly to different sections within a document.
@ -91,4 +84,4 @@ append an incrementing integer as needed for uniqueness.
[github-section-links]: https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#section-links [github-section-links]: https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#section-links
[github-heading-algorithm]: https://github.com/gjtorikian/html-pipeline/blob/f13a1534cb650ba17af400d1acd3a22c28004c09/lib/html/pipeline/toc_filter.rb [github-heading-algorithm]: https://github.com/gjtorikian/html-pipeline/blob/f13a1534cb650ba17af400d1acd3a22c28004c09/lib/html/pipeline/toc_filter.rb
[github-lines-links]: https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/creating-a-permanent-link-to-a-code-snippet#linking-to-markdown#linking-to-markdown [github-linking-to-content]: https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/creating-a-permanent-link-to-a-code-snippet#linking-to-markdown#linking-to-markdown

View file

@ -11,6 +11,7 @@ const { filterByPredicate, filterByTypes, getHtmlTagInfo } =
const idRe = getHtmlAttributeRe("id"); const idRe = getHtmlAttributeRe("id");
const nameRe = getHtmlAttributeRe("name"); const nameRe = getHtmlAttributeRe("name");
const anchorRe = /\{(#[a-z\d]+(?:[-_][a-z\d]+)*)\}/gu; const anchorRe = /\{(#[a-z\d]+(?:[-_][a-z\d]+)*)\}/gu;
const lineFragmentRe = /^#(?:L\d+(?:C\d+)?-L\d+(?:C\d+)?|L\d+)$/;
// Sets for filtering heading tokens during conversion // Sets for filtering heading tokens during conversion
const childrenExclude = new Set([ "image", "reference", "resource" ]); const childrenExclude = new Set([ "image", "reference", "resource" ]);
@ -120,7 +121,6 @@ module.exports = {
const { endColumn, startColumn } = definition; const { endColumn, startColumn } = definition;
const text = unescapeStringTokenText(definition); const text = unescapeStringTokenText(definition);
const encodedText = `#${encodeURIComponent(text.slice(1))}`; const encodedText = `#${encodeURIComponent(text.slice(1))}`;
const lineFragmentRe = /^#L\d+(?:C\d+)?(?:-L\d+(?:C\d+)?)?$/;
if ( if (
(text.length > 1) && (text.length > 1) &&
text.startsWith("#") && text.startsWith("#") &&

View file

@ -86,21 +86,17 @@
[Valid][escapedref] [Valid][escapedref]
[Valid](#l12-not-a-line-link)
[Valid](#L7) [Valid](#L7)
[Valid](#L123)
[Valid](#L30C11-L31C9)
[Valid](#L30C11)
[Valid](#L30C11-L31)
[Valid](#L30C11-L31)
[Valid](#L30-L31) [Valid](#L30-L31)
[Valid](#l12-abc) [Valid](#L3C24-L88)
[Valid](#L304-L314C98)
[Valid](#L200C4-L3244C2)
### Valid H3 Heading ### Valid H3 Heading
@ -187,7 +183,7 @@ Text
### Valid Heading\-With\_Embedded\_Escaping ### Valid Heading\-With\_Embedded\_Escaping
### L12 ABC ### L12 Not A Line Link
<a name="namedlink"></a> <a name="namedlink"></a>
@ -298,22 +294,36 @@ Valid Setext Heading with Named Fragment {#setext}
[Invalid](#uppercase) {MD051} [Invalid](#uppercase) {MD051}
[Invalid](#L12-not-a-line-link) {MD051}
[Invalid](#l7) {MD051} [Invalid](#l7) {MD051}
[Invalid](#L12-abc) {MD051}
[Invalid](#L7abc) {MD051}
[Invalid](#L) {MD051} [Invalid](#L) {MD051}
[Invalid](#L7extra) {MD051}
[Invalid](#L30C) {MD051} [Invalid](#L30C) {MD051}
[Invalid](#L30Cextra) {MD051}
[Invalid](#L30L12) {MD051} [Invalid](#L30L12) {MD051}
[Invalid](#L30C12) {MD051}
[Invalid](#L30C11-) {MD051} [Invalid](#L30C11-) {MD051}
[Invalid](#L30C11-L) {MD051}
[Invalid](#L30C11-L31C) {MD051} [Invalid](#L30C11-L31C) {MD051}
[Invalid](#L30C11-C31) {MD051}
[Invalid](#C30) {MD051}
[Invalid](#C11-C31) {MD051}
[Invalid](#C11-L4C31) {MD051}
<!-- markdownlint-configure-file { <!-- markdownlint-configure-file {
"emphasis-style": false, "emphasis-style": false,
"heading-style": false, "heading-style": false,

View file

@ -23678,7 +23678,7 @@ Generated by [AVA](https://avajs.dev).
37, 37,
], ],
fixInfo: null, fixInfo: null,
lineNumber: 214, lineNumber: 210,
ruleDescription: 'Link fragments should be valid', ruleDescription: 'Link fragments should be valid',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md', ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md',
ruleNames: [ ruleNames: [
@ -23694,7 +23694,7 @@ Generated by [AVA](https://avajs.dev).
31, 31,
], ],
fixInfo: null, fixInfo: null,
lineNumber: 216, lineNumber: 212,
ruleDescription: 'Link fragments should be valid', ruleDescription: 'Link fragments should be valid',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md', ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md',
ruleNames: [ ruleNames: [
@ -23710,7 +23710,7 @@ Generated by [AVA](https://avajs.dev).
36, 36,
], ],
fixInfo: null, fixInfo: null,
lineNumber: 218, lineNumber: 214,
ruleDescription: 'Link fragments should be valid', ruleDescription: 'Link fragments should be valid',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md', ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md',
ruleNames: [ ruleNames: [
@ -23726,7 +23726,7 @@ Generated by [AVA](https://avajs.dev).
28, 28,
], ],
fixInfo: null, fixInfo: null,
lineNumber: 220, lineNumber: 216,
ruleDescription: 'Link fragments should be valid', ruleDescription: 'Link fragments should be valid',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md', ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md',
ruleNames: [ ruleNames: [
@ -23742,7 +23742,7 @@ Generated by [AVA](https://avajs.dev).
18, 18,
], ],
fixInfo: null, fixInfo: null,
lineNumber: 222, lineNumber: 218,
ruleDescription: 'Link fragments should be valid', ruleDescription: 'Link fragments should be valid',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md', ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md',
ruleNames: [ ruleNames: [
@ -23762,7 +23762,7 @@ Generated by [AVA](https://avajs.dev).
editColumn: 11, editColumn: 11,
insertText: '#HREFandID', insertText: '#HREFandID',
}, },
lineNumber: 224, lineNumber: 220,
ruleDescription: 'Link fragments should be valid', ruleDescription: 'Link fragments should be valid',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md', ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md',
ruleNames: [ ruleNames: [
@ -23778,7 +23778,7 @@ Generated by [AVA](https://avajs.dev).
34, 34,
], ],
fixInfo: null, fixInfo: null,
lineNumber: 226, lineNumber: 222,
ruleDescription: 'Link fragments should be valid', ruleDescription: 'Link fragments should be valid',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md', ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md',
ruleNames: [ ruleNames: [
@ -23794,7 +23794,7 @@ Generated by [AVA](https://avajs.dev).
34, 34,
], ],
fixInfo: null, fixInfo: null,
lineNumber: 228, lineNumber: 224,
ruleDescription: 'Link fragments should be valid', ruleDescription: 'Link fragments should be valid',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md', ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md',
ruleNames: [ ruleNames: [
@ -23810,7 +23810,7 @@ Generated by [AVA](https://avajs.dev).
39, 39,
], ],
fixInfo: null, fixInfo: null,
lineNumber: 230, lineNumber: 226,
ruleDescription: 'Link fragments should be valid', ruleDescription: 'Link fragments should be valid',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md', ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md',
ruleNames: [ ruleNames: [
@ -23823,7 +23823,7 @@ Generated by [AVA](https://avajs.dev).
errorDetail: null, errorDetail: null,
errorRange: null, errorRange: null,
fixInfo: null, fixInfo: null,
lineNumber: 232, lineNumber: 228,
ruleDescription: 'Link fragments should be valid', ruleDescription: 'Link fragments should be valid',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md', ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md',
ruleNames: [ ruleNames: [
@ -23839,7 +23839,7 @@ Generated by [AVA](https://avajs.dev).
28, 28,
], ],
fixInfo: null, fixInfo: null,
lineNumber: 237, lineNumber: 233,
ruleDescription: 'Link fragments should be valid', ruleDescription: 'Link fragments should be valid',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md', ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md',
ruleNames: [ ruleNames: [
@ -23859,7 +23859,7 @@ Generated by [AVA](https://avajs.dev).
editColumn: 9, editColumn: 9,
insertText: '#valid-fragments', insertText: '#valid-fragments',
}, },
lineNumber: 241, lineNumber: 237,
ruleDescription: 'Link fragments should be valid', ruleDescription: 'Link fragments should be valid',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md', ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md',
ruleNames: [ ruleNames: [
@ -23879,7 +23879,7 @@ Generated by [AVA](https://avajs.dev).
editColumn: 12, editColumn: 12,
insertText: '#namedlink', insertText: '#namedlink',
}, },
lineNumber: 243, lineNumber: 239,
ruleDescription: 'Link fragments should be valid', ruleDescription: 'Link fragments should be valid',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md', ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md',
ruleNames: [ ruleNames: [
@ -23892,7 +23892,7 @@ Generated by [AVA](https://avajs.dev).
errorDetail: 'Expected: #namedlink; Actual: #NAMEDLINK', errorDetail: 'Expected: #namedlink; Actual: #NAMEDLINK',
errorRange: null, errorRange: null,
fixInfo: null, fixInfo: null,
lineNumber: 245, lineNumber: 241,
ruleDescription: 'Link fragments should be valid', ruleDescription: 'Link fragments should be valid',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md', ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md',
ruleNames: [ ruleNames: [
@ -23912,7 +23912,7 @@ Generated by [AVA](https://avajs.dev).
editColumn: 13, editColumn: 13,
insertText: '#idlink', insertText: '#idlink',
}, },
lineNumber: 250, lineNumber: 246,
ruleDescription: 'Link fragments should be valid', ruleDescription: 'Link fragments should be valid',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md', ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md',
ruleNames: [ ruleNames: [
@ -23928,7 +23928,7 @@ Generated by [AVA](https://avajs.dev).
26, 26,
], ],
fixInfo: null, fixInfo: null,
lineNumber: 285, lineNumber: 281,
ruleDescription: 'Link fragments should be valid', ruleDescription: 'Link fragments should be valid',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md', ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md',
ruleNames: [ ruleNames: [
@ -23944,7 +23944,7 @@ Generated by [AVA](https://avajs.dev).
26, 26,
], ],
fixInfo: null, fixInfo: null,
lineNumber: 287, lineNumber: 283,
ruleDescription: 'Link fragments should be valid', ruleDescription: 'Link fragments should be valid',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md', ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md',
ruleNames: [ ruleNames: [
@ -23960,7 +23960,7 @@ Generated by [AVA](https://avajs.dev).
20, 20,
], ],
fixInfo: null, fixInfo: null,
lineNumber: 289, lineNumber: 285,
ruleDescription: 'Link fragments should be valid', ruleDescription: 'Link fragments should be valid',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md', ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md',
ruleNames: [ ruleNames: [
@ -23976,7 +23976,7 @@ Generated by [AVA](https://avajs.dev).
23, 23,
], ],
fixInfo: null, fixInfo: null,
lineNumber: 291, lineNumber: 287,
ruleDescription: 'Link fragments should be valid', ruleDescription: 'Link fragments should be valid',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md', ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md',
ruleNames: [ ruleNames: [
@ -23992,7 +23992,7 @@ Generated by [AVA](https://avajs.dev).
22, 22,
], ],
fixInfo: null, fixInfo: null,
lineNumber: 293, lineNumber: 289,
ruleDescription: 'Link fragments should be valid', ruleDescription: 'Link fragments should be valid',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md', ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md',
ruleNames: [ ruleNames: [
@ -24008,7 +24008,7 @@ Generated by [AVA](https://avajs.dev).
42, 42,
], ],
fixInfo: null, fixInfo: null,
lineNumber: 295, lineNumber: 291,
ruleDescription: 'Link fragments should be valid', ruleDescription: 'Link fragments should be valid',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md', ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md',
ruleNames: [ ruleNames: [
@ -24024,7 +24024,7 @@ Generated by [AVA](https://avajs.dev).
21, 21,
], ],
fixInfo: null, fixInfo: null,
lineNumber: 297, lineNumber: 293,
ruleDescription: 'Link fragments should be valid', ruleDescription: 'Link fragments should be valid',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md', ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md',
ruleNames: [ ruleNames: [
@ -24040,7 +24040,27 @@ Generated by [AVA](https://avajs.dev).
21, 21,
], ],
fixInfo: null, fixInfo: null,
lineNumber: 299, lineNumber: 295,
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](#L12-not-a-line-link)',
errorDetail: 'Expected: #l12-not-a-line-link; Actual: #L12-not-a-line-link',
errorRange: [
1,
31,
],
fixInfo: {
deleteCount: 20,
editColumn: 11,
insertText: '#l12-not-a-line-link',
},
lineNumber: 297,
ruleDescription: 'Link fragments should be valid', ruleDescription: 'Link fragments should be valid',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md', ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md',
ruleNames: [ ruleNames: [
@ -24056,43 +24076,7 @@ Generated by [AVA](https://avajs.dev).
14, 14,
], ],
fixInfo: null, fixInfo: null,
lineNumber: 301, lineNumber: 299,
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](#L12-abc)',
errorDetail: 'Expected: #l12-abc; Actual: #L12-abc',
errorRange: [
1,
19,
],
fixInfo: {
deleteCount: 8,
editColumn: 11,
insertText: '#l12-abc',
},
lineNumber: 303,
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](#L7abc)',
errorDetail: null,
errorRange: [
1,
17,
],
fixInfo: null,
lineNumber: 305,
ruleDescription: 'Link fragments should be valid', ruleDescription: 'Link fragments should be valid',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md', ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md',
ruleNames: [ ruleNames: [
@ -24108,7 +24092,23 @@ Generated by [AVA](https://avajs.dev).
13, 13,
], ],
fixInfo: null, fixInfo: null,
lineNumber: 307, lineNumber: 301,
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](#L7extra)',
errorDetail: null,
errorRange: [
1,
19,
],
fixInfo: null,
lineNumber: 303,
ruleDescription: 'Link fragments should be valid', ruleDescription: 'Link fragments should be valid',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md', ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md',
ruleNames: [ ruleNames: [
@ -24124,7 +24124,23 @@ Generated by [AVA](https://avajs.dev).
16, 16,
], ],
fixInfo: null, fixInfo: null,
lineNumber: 309, lineNumber: 305,
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](#L30Cextra)',
errorDetail: null,
errorRange: [
1,
21,
],
fixInfo: null,
lineNumber: 307,
ruleDescription: 'Link fragments should be valid', ruleDescription: 'Link fragments should be valid',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md', ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md',
ruleNames: [ ruleNames: [
@ -24140,6 +24156,22 @@ Generated by [AVA](https://avajs.dev).
18, 18,
], ],
fixInfo: null, fixInfo: null,
lineNumber: 309,
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](#L30C12)',
errorDetail: null,
errorRange: [
1,
18,
],
fixInfo: null,
lineNumber: 311, lineNumber: 311,
ruleDescription: 'Link fragments should be valid', ruleDescription: 'Link fragments should be valid',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md', ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md',
@ -24164,6 +24196,22 @@ Generated by [AVA](https://avajs.dev).
'link-fragments', 'link-fragments',
], ],
}, },
{
errorContext: '[Invalid](#L30C11-L)',
errorDetail: null,
errorRange: [
1,
20,
],
fixInfo: null,
lineNumber: 315,
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](#L30C11-L31C)', errorContext: '[Invalid](#L30C11-L31C)',
errorDetail: null, errorDetail: null,
@ -24172,7 +24220,71 @@ Generated by [AVA](https://avajs.dev).
23, 23,
], ],
fixInfo: null, fixInfo: null,
lineNumber: 315, lineNumber: 317,
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](#L30C11-C31)',
errorDetail: null,
errorRange: [
1,
22,
],
fixInfo: null,
lineNumber: 319,
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](#C30)',
errorDetail: null,
errorRange: [
1,
15,
],
fixInfo: null,
lineNumber: 321,
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](#C11-C31)',
errorDetail: null,
errorRange: [
1,
19,
],
fixInfo: null,
lineNumber: 323,
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](#C11-L4C31)',
errorDetail: null,
errorRange: [
1,
21,
],
fixInfo: null,
lineNumber: 325,
ruleDescription: 'Link fragments should be valid', ruleDescription: 'Link fragments should be valid',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md', ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md051.md',
ruleNames: [ ruleNames: [
@ -24269,21 +24381,17 @@ Generated by [AVA](https://avajs.dev).
[Valid][escapedref]␊ [Valid][escapedref]␊
[Valid](#l12-not-a-line-link)␊
[Valid](#L7)␊ [Valid](#L7)␊
[Valid](#L123)␊
[Valid](#L30C11-L31C9)␊
[Valid](#L30C11)␊
[Valid](#L30C11-L31)␊
[Valid](#L30C11-L31)␊
[Valid](#L30-L31)␊ [Valid](#L30-L31)␊
[Valid](#l12-abc)␊ [Valid](#L3C24-L88)␊
[Valid](#L304-L314C98)␊
[Valid](#L200C4-L3244C2)␊
### Valid H3 Heading␊ ### Valid H3 Heading␊
@ -24370,7 +24478,7 @@ Generated by [AVA](https://avajs.dev).
### Valid Heading\\-With\\_Embedded\\_Escaping␊ ### Valid Heading\\-With\\_Embedded\\_Escaping␊
### L12 ABC ### L12 Not A Line Link
<a name="namedlink"></a> <a name="namedlink"></a>
@ -24481,22 +24589,36 @@ Generated by [AVA](https://avajs.dev).
[Invalid](#uppercase) {MD051}␊ [Invalid](#uppercase) {MD051}␊
[Invalid](#l12-not-a-line-link) {MD051}␊
[Invalid](#l7) {MD051}␊ [Invalid](#l7) {MD051}␊
[Invalid](#l12-abc) {MD051}␊
[Invalid](#L7abc) {MD051}␊
[Invalid](#L) {MD051}␊ [Invalid](#L) {MD051}␊
[Invalid](#L7extra) {MD051}␊
[Invalid](#L30C) {MD051}␊ [Invalid](#L30C) {MD051}␊
[Invalid](#L30Cextra) {MD051}␊
[Invalid](#L30L12) {MD051}␊ [Invalid](#L30L12) {MD051}␊
[Invalid](#L30C12) {MD051}␊
[Invalid](#L30C11-) {MD051}␊ [Invalid](#L30C11-) {MD051}␊
[Invalid](#L30C11-L) {MD051}␊
[Invalid](#L30C11-L31C) {MD051}␊ [Invalid](#L30C11-L31C) {MD051}␊
[Invalid](#L30C11-C31) {MD051}␊
[Invalid](#C30) {MD051}␊
[Invalid](#C11-C31) {MD051}␊
[Invalid](#C11-L4C31) {MD051}␊
<!-- markdownlint-configure-file {␊ <!-- markdownlint-configure-file {␊
"emphasis-style": false,␊ "emphasis-style": false,␊
"heading-style": false,␊ "heading-style": false,␊