mirror of
https://github.com/theoludwig/markdownlint-rule-relative-links.git
synced 2026-02-28 16:03:02 +01:00
feat: add config-option for fragment-index-divider (#20)
This commit is contained in:
13
test/fixtures/valid/existing-heading-fragment-divider/awesome.md
vendored
Normal file
13
test/fixtures/valid/existing-heading-fragment-divider/awesome.md
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
# Awesome
|
||||
|
||||
## Existing Heading
|
||||
|
||||
### Repeated Heading
|
||||
|
||||
Text
|
||||
|
||||
### Repeated Heading
|
||||
|
||||
Text
|
||||
|
||||
### Repeated Heading
|
||||
9
test/fixtures/valid/existing-heading-fragment-divider/existing-heading-fragment.md
vendored
Normal file
9
test/fixtures/valid/existing-heading-fragment-divider/existing-heading-fragment.md
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
# Valid
|
||||
|
||||
[Link fragment](./awesome.md#existing-heading)
|
||||
|
||||
[Link fragment Repeated 0](./awesome.md#repeated-heading)
|
||||
|
||||
[Link fragment Repeated 1](./awesome.md#repeated-heading_1)
|
||||
|
||||
[Link fragment Repeated 2](./awesome.md#repeated-heading_2)
|
||||
@@ -239,6 +239,16 @@ test("ensure the rule validates correctly", async (t) => {
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "should be valid with multiple existing element id fragments",
|
||||
fixturePath:
|
||||
"test/fixtures/valid/existing-heading-fragment-divider/existing-heading-fragment.md",
|
||||
config: {
|
||||
"relative-links": {
|
||||
"fragment-index-divider": "_",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "should ignore external image links",
|
||||
fixturePath: "test/fixtures/valid/ignore-external-image.md",
|
||||
|
||||
Reference in New Issue
Block a user