Update tests and documentation for MD034/no-bare-urls to explain edge case behavior.

This commit is contained in:
David Anson 2023-02-06 21:09:58 -08:00
parent b990b3ea77
commit ddb71ed1e8
6 changed files with 106 additions and 3 deletions

View file

@ -1431,12 +1431,25 @@ Not a clickable link: `https://www.example.com`
```
Note: The following scenario does not trigger this rule because it could be a
valid shortcut link:
shortcut link:
```markdown
[https://www.example.com]
```
Note: The following syntax triggers this rule because the nested link could be
a shortcut link (which takes precedence):
```markdown
[text [shortcut] text](https://example.com)
```
To avoid this, escape both inner brackets:
```markdown
[link \[text\] link](https://example.com)
```
Rationale: Without angle brackets, a bare URL or email isn't converted into a
link by some Markdown parsers.

View file

@ -27,11 +27,24 @@ Not a clickable link: `https://www.example.com`
```
Note: The following scenario does not trigger this rule because it could be a
valid shortcut link:
shortcut link:
```markdown
[https://www.example.com]
```
Note: The following syntax triggers this rule because the nested link could be
a shortcut link (which takes precedence):
```markdown
[text [shortcut] text](https://example.com)
```
To avoid this, escape both inner brackets:
```markdown
[link \[text\] link](https://example.com)
```
Rationale: Without angle brackets, a bare URL or email isn't converted into a
link by some Markdown parsers.