mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-16 14:00:13 +01:00
Update MD051/link-fragments to add ignore_case parameter and improve documentation (fixes #1274).
This commit is contained in:
parent
74aa96d19d
commit
04c693b00b
16 changed files with 315 additions and 44 deletions
14
doc/Rules.md
14
doc/Rules.md
|
|
@ -2100,6 +2100,10 @@ Tags: `links`
|
|||
|
||||
Aliases: `link-fragments`
|
||||
|
||||
Parameters:
|
||||
|
||||
- `ignore_case`: Ignore case of fragments (`boolean`, default `false`)
|
||||
|
||||
Fixable: Some violations can be fixed by tooling
|
||||
|
||||
This rule is triggered when a link fragment does not match any of the fragments
|
||||
|
|
@ -2120,9 +2124,9 @@ generated name (see below):
|
|||
[Link](#heading-name)
|
||||
```
|
||||
|
||||
Link fragments may be handled case-sensitively, so this rule requires fragments
|
||||
to exactly match the [GitHub heading algorithm][github-heading-algorithm].
|
||||
Therefore, the following example is reported as a violation:
|
||||
For consistency, this rule requires fragments to exactly match the [GitHub
|
||||
heading algorithm][github-heading-algorithm] which converts letters to
|
||||
lowercase. Therefore, the following example is reported as a violation:
|
||||
|
||||
```markdown
|
||||
# Heading Name
|
||||
|
|
@ -2130,6 +2134,10 @@ Therefore, the following example is reported as a violation:
|
|||
[Link](#Heading-Name)
|
||||
```
|
||||
|
||||
To ignore case when comparing fragments with heading names, the `ignore_case`
|
||||
parameter can be set to `true`. In this configuration, the previous example is
|
||||
not reported as a violation.
|
||||
|
||||
Alternatively, some platforms allow the syntax `{#named-anchor}` to be used
|
||||
within a heading to provide a specific name (consisting of only lower-case
|
||||
letters, numbers, `-`, and `_`):
|
||||
|
|
|
|||
14
doc/md051.md
14
doc/md051.md
|
|
@ -4,6 +4,10 @@ Tags: `links`
|
|||
|
||||
Aliases: `link-fragments`
|
||||
|
||||
Parameters:
|
||||
|
||||
- `ignore_case`: Ignore case of fragments (`boolean`, default `false`)
|
||||
|
||||
Fixable: Some violations can be fixed by tooling
|
||||
|
||||
This rule is triggered when a link fragment does not match any of the fragments
|
||||
|
|
@ -24,9 +28,9 @@ generated name (see below):
|
|||
[Link](#heading-name)
|
||||
```
|
||||
|
||||
Link fragments may be handled case-sensitively, so this rule requires fragments
|
||||
to exactly match the [GitHub heading algorithm][github-heading-algorithm].
|
||||
Therefore, the following example is reported as a violation:
|
||||
For consistency, this rule requires fragments to exactly match the [GitHub
|
||||
heading algorithm][github-heading-algorithm] which converts letters to
|
||||
lowercase. Therefore, the following example is reported as a violation:
|
||||
|
||||
```markdown
|
||||
# Heading Name
|
||||
|
|
@ -34,6 +38,10 @@ Therefore, the following example is reported as a violation:
|
|||
[Link](#Heading-Name)
|
||||
```
|
||||
|
||||
To ignore case when comparing fragments with heading names, the `ignore_case`
|
||||
parameter can be set to `true`. In this configuration, the previous example is
|
||||
not reported as a violation.
|
||||
|
||||
Alternatively, some platforms allow the syntax `{#named-anchor}` to be used
|
||||
within a heading to provide a specific name (consisting of only lower-case
|
||||
letters, numbers, `-`, and `_`):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue