Update MD034/no-bare-urls to allow bare URLs inside the link text of HTML A tags (fixes 615).

This commit is contained in:
David Anson 2022-11-13 21:39:14 -08:00
parent 2e63bf7dd8
commit f84c91d95f
5 changed files with 99 additions and 8 deletions

View file

@ -2926,6 +2926,46 @@ Generated by [AVA](https://avajs.dev).
'no-bare-urls',
],
},
{
errorContext: 'https://example.com',
errorDetail: null,
errorRange: [
25,
19,
],
fixInfo: {
deleteCount: 19,
editColumn: 25,
insertText: '<https://example.com>',
},
lineNumber: 29,
ruleDescription: 'Bare URL used',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md034.md',
ruleNames: [
'MD034',
'no-bare-urls',
],
},
{
errorContext: 'https://example.com',
errorDetail: null,
errorRange: [
26,
19,
],
fixInfo: {
deleteCount: 19,
editColumn: 26,
insertText: '<https://example.com>',
},
lineNumber: 31,
ruleDescription: 'Bare URL used',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md034.md',
ruleNames: [
'MD034',
'no-bare-urls',
],
},
],
fixed: `# Detailed Results Bare URLs␊
@ -2940,6 +2980,24 @@ Generated by [AVA](https://avajs.dev).
Visit <https://example.com>, then refresh. {MD034}␊
The site (<https://example.com>) is down. {MD034}␊
<!-- markdownlint-disable line-length no-inline-html -->
Some documents use <a href="https://example.com">to link</a>.␊
Or <a href="https://example.com/info.htm">to link</a>.␊
Or repeat the URL <a href="https://example.com">https://example.com</a>.␊
Or <a href="https://example.com/info.htm">https://example.com/info.htm</a>.␊
This is allowed to avoid embedding angle brackets in HTML <a href="https://example.com">Text https://example.com</a>.␊
As is <a href="https://example.com/info.htm">https://example.com/info.htm text</a>.␊
<br> Another violation: <https://example.com>. {MD034} <br>
<br/> Another violation: <https://example.com>. {MD034} <br/>
`,
}