mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-09-22 05:40:48 +02:00
Update MD054/link-image-style to add url_inline parameter (fixes #753).
This commit is contained in:
parent
84333a5f08
commit
b709a2f624
26 changed files with 347 additions and 39 deletions
15
doc/Rules.md
15
doc/Rules.md
|
@ -2240,6 +2240,7 @@ Parameters:
|
|||
- `inline`: Allow inline links and images (`boolean`, default `true`)
|
||||
- `shortcut`: Allow shortcut reference links and images (`boolean`, default
|
||||
`true`)
|
||||
- `url_inline`: Allow URLs as inline links (`boolean`, default `true`)
|
||||
|
||||
Fixable: Some violations can be fixed by tooling
|
||||
|
||||
|
@ -2305,6 +2306,20 @@ This rule does *not* fix scenarios that require converting a link or image to
|
|||
the `full`, `collapsed`, or `shortcut` reference styles because that involves
|
||||
naming the reference and determining where to insert it in the document.
|
||||
|
||||
Setting the `url_inline` parameter to `false` prevents the use of inline links
|
||||
with the same absolute URL text/destination and no title because such links can
|
||||
be converted to autolinks:
|
||||
|
||||
```markdown
|
||||
[https://example.com](https://example.com)
|
||||
```
|
||||
|
||||
To fix `url_inline` violations, use the simpler autolink syntax instead:
|
||||
|
||||
```markdown
|
||||
<https://example.com>
|
||||
```
|
||||
|
||||
Rationale: Consistent formatting makes it easier to understand a document.
|
||||
Autolinks are concise, but appear as URLs which can be long and confusing.
|
||||
Inline links and images can include descriptive text, but take up more space in
|
||||
|
|
15
doc/md054.md
15
doc/md054.md
|
@ -13,6 +13,7 @@ Parameters:
|
|||
- `inline`: Allow inline links and images (`boolean`, default `true`)
|
||||
- `shortcut`: Allow shortcut reference links and images (`boolean`, default
|
||||
`true`)
|
||||
- `url_inline`: Allow URLs as inline links (`boolean`, default `true`)
|
||||
|
||||
Fixable: Some violations can be fixed by tooling
|
||||
|
||||
|
@ -78,6 +79,20 @@ This rule does *not* fix scenarios that require converting a link or image to
|
|||
the `full`, `collapsed`, or `shortcut` reference styles because that involves
|
||||
naming the reference and determining where to insert it in the document.
|
||||
|
||||
Setting the `url_inline` parameter to `false` prevents the use of inline links
|
||||
with the same absolute URL text/destination and no title because such links can
|
||||
be converted to autolinks:
|
||||
|
||||
```markdown
|
||||
[https://example.com](https://example.com)
|
||||
```
|
||||
|
||||
To fix `url_inline` violations, use the simpler autolink syntax instead:
|
||||
|
||||
```markdown
|
||||
<https://example.com>
|
||||
```
|
||||
|
||||
Rationale: Consistent formatting makes it easier to understand a document.
|
||||
Autolinks are concise, but appear as URLs which can be long and confusing.
|
||||
Inline links and images can include descriptive text, but take up more space in
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue