Update MD054/link-image-style to add url_inline parameter (fixes #753).

This commit is contained in:
David Anson 2023-11-12 22:42:02 -08:00
parent 84333a5f08
commit b709a2f624
26 changed files with 347 additions and 39 deletions

View file

@ -1,4 +1,4 @@
# Link Style autolink_only
# Link Style Autolink Only
Text [url](https://example.com) text {MD054}

View file

@ -1,4 +1,4 @@
# Link Style autolink_or_inline
# Link Style Autolink or Inline
Text [url](https://example.com) text

View file

@ -1,4 +1,4 @@
# Link Style autolink_or_reference
# Link Style Autolink or Reference
Text [url](https://example.com) text {MD054}

View file

@ -1,4 +1,4 @@
# Link Style reference_only
# Link Style Collapsed Only
Text [url](https://example.com) text {MD054}

View file

@ -1,4 +1,4 @@
# Link Style reference_only
# Link Style Full Only
Text [url](https://example.com) text {MD054}

View file

@ -1,4 +1,4 @@
# Link Style inline_only
# Link Style Inline Only
Text [url](https://example.com) text

View file

@ -1,4 +1,4 @@
# Link Style inline_or_reference
# Link Style Inline or Reference
Text [url](https://example.com) text

View file

@ -0,0 +1,37 @@
# Link Style No URL Inline Not Possible
Text [https://example.com](https://example.com) text
Text ![https://example.com](https://example.com) text
Text [https://example.com](<https://example.com>) text
Text ![https://example.com](<https://example.com>) text
Text [https://example.com](https://example.com/page "title") text
Text ![https://example.com](https://example.com/page "title") text
Text [https://example.com](https://example.com "title") text
Text ![https://example.com](https://example.com "title") text
Text [https://example.com][url] text
Text ![https://example.com][url] text
Text [https://example.com][url-title] text
Text ![https://example.com][url-title] text
Text <https://example.com> text {MD054}
[url]: https://example.com
[url-title]: https://example.com "title"
<!-- markdownlint-configure-file {
"link-image-style": {
"autolink": false,
"url_inline": false
}
} -->

View file

@ -0,0 +1,36 @@
# Link Style No URL Inline Possible
Text [https://example.com](https://example.com) text {MD054}
Text ![https://example.com](https://example.com) text
Text [https://example.com](<https://example.com>) text {MD054}
Text ![https://example.com](<https://example.com>) text
Text [https://example.com](https://example.com/page "title") text
Text ![https://example.com](https://example.com/page "title") text
Text [https://example.com](https://example.com "title") text
Text ![https://example.com](https://example.com "title") text
Text [https://example.com][url] text
Text ![https://example.com][url] text
Text [https://example.com][url-title] text
Text ![https://example.com][url-title] text
Text <https://example.com> text
[url]: https://example.com
[url-title]: https://example.com "title"
<!-- markdownlint-configure-file {
"link-image-style": {
"url_inline": false
}
} -->

View file

@ -1,4 +1,4 @@
# Link Style autolink_only
# Link Style None
Text [url](https://example.com) text {MD054}

View file

@ -1,4 +1,4 @@
# Link Style reference_only
# Link Style Reference Only
Text [url](https://example.com) text {MD054}

View file

@ -1,4 +1,4 @@
# Link Style reference_only
# Link Style Shortcut Only
Text [url](https://example.com) text {MD054}

View file

@ -915,7 +915,7 @@ test("readme", async(t) => {
});
test("validateJsonUsingConfigSchemaStrict", async(t) => {
t.plan(169);
t.plan(171);
const { addSchema, validate } =
await import("@hyperjump/json-schema/draft-07");
addSchema(configSchemaStrict, configSchemaStrictUri);

View file

@ -24749,7 +24749,7 @@ Generated by [AVA](https://avajs.dev).
],
},
],
fixed: `# Link Style autolink_only␊
fixed: `# Link Style Autolink Only␊
Text <https://example.com> text {MD054}␊
@ -24999,7 +24999,7 @@ Generated by [AVA](https://avajs.dev).
],
},
],
fixed: `# Link Style autolink_or_inline␊
fixed: `# Link Style Autolink or Inline␊
Text [url](https://example.com) text␊
@ -25386,7 +25386,7 @@ Generated by [AVA](https://avajs.dev).
],
},
],
fixed: `# Link Style autolink_or_reference␊
fixed: `# Link Style Autolink or Reference␊
Text <https://example.com> text {MD054}␊
@ -25898,7 +25898,7 @@ Generated by [AVA](https://avajs.dev).
],
},
],
fixed: `# Link Style reference_only␊
fixed: `# Link Style Collapsed Only␊
Text [url](https://example.com) text {MD054}␊
@ -26413,7 +26413,7 @@ Generated by [AVA](https://avajs.dev).
],
},
],
fixed: `# Link Style reference_only␊
fixed: `# Link Style Full Only␊
Text [url](https://example.com) text {MD054}␊
@ -26742,7 +26742,7 @@ Generated by [AVA](https://avajs.dev).
],
},
],
fixed: `# Link Style inline_only␊
fixed: `# Link Style Inline Only␊
Text [url](https://example.com) text␊
@ -26912,7 +26912,7 @@ Generated by [AVA](https://avajs.dev).
],
},
],
fixed: `# Link Style inline_or_reference␊
fixed: `# Link Style Inline or Reference␊
Text [url](https://example.com) text␊
@ -26991,6 +26991,159 @@ Generated by [AVA](https://avajs.dev).
`,
}
## link-style-no-url-inline-not-possible.md
> Snapshot 1
{
errors: [
{
errorContext: '<https://example.com>',
errorDetail: null,
errorRange: [
6,
21,
],
fixInfo: {
deleteCount: 21,
editColumn: 6,
insertText: '[https://example.com](https://example.com)',
},
lineNumber: 27,
ruleDescription: 'Link and image style',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md',
ruleNames: [
'MD054',
'link-image-style',
],
},
],
fixed: `# Link Style No URL Inline Not Possible␊
Text [https://example.com](https://example.com) text␊
Text ![https://example.com](https://example.com) text␊
Text [https://example.com](<https://example.com>) text␊
Text ![https://example.com](<https://example.com>) text␊
Text [https://example.com](https://example.com/page "title") text␊
Text ![https://example.com](https://example.com/page "title") text␊
Text [https://example.com](https://example.com "title") text␊
Text ![https://example.com](https://example.com "title") text␊
Text [https://example.com][url] text␊
Text ![https://example.com][url] text␊
Text [https://example.com][url-title] text␊
Text ![https://example.com][url-title] text␊
Text [https://example.com](https://example.com) text {MD054}␊
[url]: https://example.com␊
[url-title]: https://example.com "title"␊
<!-- markdownlint-configure-file {␊
"link-image-style": {␊
"autolink": false,␊
"url_inline": false␊
}␊
} -->␊
`,
}
## link-style-no-url-inline-possible.md
> Snapshot 1
{
errors: [
{
errorContext: '[https://example.com](https://...',
errorDetail: null,
errorRange: [
6,
42,
],
fixInfo: {
deleteCount: 42,
editColumn: 6,
insertText: '<https://example.com>',
},
lineNumber: 3,
ruleDescription: 'Link and image style',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md',
ruleNames: [
'MD054',
'link-image-style',
],
},
{
errorContext: '[https://example.com](<https:/...',
errorDetail: null,
errorRange: [
6,
44,
],
fixInfo: {
deleteCount: 44,
editColumn: 6,
insertText: '<https://example.com>',
},
lineNumber: 7,
ruleDescription: 'Link and image style',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md054.md',
ruleNames: [
'MD054',
'link-image-style',
],
},
],
fixed: `# Link Style No URL Inline Possible␊
Text <https://example.com> text {MD054}␊
Text ![https://example.com](https://example.com) text␊
Text <https://example.com> text {MD054}␊
Text ![https://example.com](<https://example.com>) text␊
Text [https://example.com](https://example.com/page "title") text␊
Text ![https://example.com](https://example.com/page "title") text␊
Text [https://example.com](https://example.com "title") text␊
Text ![https://example.com](https://example.com "title") text␊
Text [https://example.com][url] text␊
Text ![https://example.com][url] text␊
Text [https://example.com][url-title] text␊
Text ![https://example.com][url-title] text␊
Text <https://example.com> text␊
[url]: https://example.com␊
[url-title]: https://example.com "title"␊
<!-- markdownlint-configure-file {␊
"link-image-style": {␊
"url_inline": false␊
}␊
} -->␊
`,
}
## link-style-none.md
> Snapshot 1
@ -27456,7 +27609,7 @@ Generated by [AVA](https://avajs.dev).
],
},
],
fixed: `# Link Style autolink_only
fixed: `# Link Style None
Text [url](https://example.com) text {MD054}␊
@ -27877,7 +28030,7 @@ Generated by [AVA](https://avajs.dev).
],
},
],
fixed: `# Link Style reference_only␊
fixed: `# Link Style Reference Only␊
Text [url](https://example.com) text {MD054}␊
@ -28358,7 +28511,7 @@ Generated by [AVA](https://avajs.dev).
],
},
],
fixed: `# Link Style reference_only␊
fixed: `# Link Style Shortcut Only␊
Text [url](https://example.com) text {MD054}␊