mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-09-21 21:30:47 +02:00
Add support for named heading fragments as supported by some platforms (fixes #830).
This commit is contained in:
parent
3dcb66cac5
commit
7a794192ca
8 changed files with 295 additions and 18 deletions
|
@ -2,17 +2,28 @@ This rule is triggered when a link fragment does not match any of the fragments
|
|||
that are automatically generated for headings in a document:
|
||||
|
||||
```markdown
|
||||
# Title
|
||||
# Heading Name
|
||||
|
||||
[Link](#fragment)
|
||||
```
|
||||
|
||||
To fix this issue, change the link fragment to reference an existing heading:
|
||||
To fix this issue, change the link fragment to reference an existing heading's
|
||||
generated name (see below):
|
||||
|
||||
```markdown
|
||||
# Title
|
||||
# Heading Name
|
||||
|
||||
[Link](#title)
|
||||
[Link](#heading-name)
|
||||
```
|
||||
|
||||
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 `_`):
|
||||
|
||||
```markdown
|
||||
# Heading Name {#custom-name}
|
||||
|
||||
[Link](#custom-name)
|
||||
```
|
||||
|
||||
Alternatively, an HTML `a` tag with an `id` or a `name` attribute can be used to
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue