mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-24 01:40:13 +01:00
Update MD034/no-bare-urls to ignore "[link]" scenario that conflicts with MD011/no-reversed-links (fixes #268).
This commit is contained in:
parent
29f16bf402
commit
dd66a33d75
8 changed files with 60 additions and 27 deletions
|
|
@ -26,3 +26,5 @@ Text <https://example.com/same> more text https://example.com/same still more te
|
|||
Text <https://example.com/same> more \* text https://example.com/same more \[ text <https://example.com/same> done
|
||||
|
||||
Text https://example.com/first more text https://example.com/second still more text https://example.com/third done
|
||||
|
||||
(Incorrect link syntax)[https://www.example.com/]
|
||||
|
|
|
|||
|
|
@ -26,3 +26,5 @@ Text <https://example.com/same> more text <https://example.com/same> still more
|
|||
Text <https://example.com/same> more \* text https://example.com/same more \[ text <https://example.com/same> done
|
||||
|
||||
Text <https://example.com/first> more text <https://example.com/second> still more text <https://example.com/third> done
|
||||
|
||||
[Incorrect link syntax](https://www.example.com/)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,13 @@
|
|||
[
|
||||
{
|
||||
"lineNumber": 30,
|
||||
"ruleNames": [ "MD011", "no-reversed-links" ],
|
||||
"ruleDescription": "Reversed link syntax",
|
||||
"ruleInformation": "https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/Rules.md#md011",
|
||||
"errorDetail": "(Incorrect link syntax)[https://www.example.com/]",
|
||||
"errorContext": null,
|
||||
"errorRange": [ 1, 49 ]
|
||||
},
|
||||
{
|
||||
"lineNumber": 3,
|
||||
"ruleNames": [ "MD034", "no-bare-urls" ],
|
||||
|
|
|
|||
|
|
@ -11,3 +11,8 @@ hTtPs://gOoGlE.cOm/ {MD034}
|
|||
ftp://user:password@ftp-server.example.com/dir/file.txt {MD034}
|
||||
|
||||
This link should be fine: <https://www.google.com/>
|
||||
|
||||
The following are allowed to avoid conflicts with MD011/no-reversed-links:
|
||||
|
||||
[https://example.com]
|
||||
[https://example.com/search?query=text]
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
Go to (this website)[https://www.example.com] {MD011} {MD034}
|
||||
Go to (this website)[https://www.example.com] {MD011}
|
||||
|
||||
However, this shouldn't trigger inside code blocks:
|
||||
|
||||
|
|
@ -6,11 +6,11 @@ However, this shouldn't trigger inside code blocks:
|
|||
|
||||
Nor inline code: `myobj.getFiles("test")[0]`
|
||||
|
||||
Two (issues)[https://www.example.com/one] in {MD011} {MD034}
|
||||
the (same text)[https://www.example.com/two]. {MD011} {MD034}
|
||||
Two (issues)[https://www.example.com/one] in {MD011}
|
||||
the (same text)[https://www.example.com/two]. {MD011}
|
||||
|
||||
<!-- markdownlint-disable line-length -->
|
||||
Two (issues)[https://www.example.com/three] on the (same line)[https://www.example.com/four]. {MD011} {MD034}
|
||||
Two (issues)[https://www.example.com/three] on the (same line)[https://www.example.com/four]. {MD011}
|
||||
|
||||
`code code
|
||||
code`
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue