mirror of
https://github.com/theoludwig/markdownlint-rule-relative-links.git
synced 2025-05-27 11:37:24 +02:00
test: add cases for fragments checking
This commit is contained in:
Before Width: | Height: | Size: 95 B After Width: | Height: | Size: 95 B |
3
test/fixtures/invalid/empty-id-fragment/awesome.md
vendored
Normal file
3
test/fixtures/invalid/empty-id-fragment/awesome.md
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
# Awesome
|
||||
|
||||
<div id>Content</div>
|
3
test/fixtures/invalid/empty-id-fragment/empty-id-fragment.md
vendored
Normal file
3
test/fixtures/invalid/empty-id-fragment/empty-id-fragment.md
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
# Invalid
|
||||
|
||||
[Link fragment](./awesome.md#)
|
3
test/fixtures/invalid/ignore-empty-fragment-checking-for-image.md
vendored
Normal file
3
test/fixtures/invalid/ignore-empty-fragment-checking-for-image.md
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
# Invalid
|
||||
|
||||

|
3
test/fixtures/invalid/ignore-fragment-checking-for-image.md
vendored
Normal file
3
test/fixtures/invalid/ignore-fragment-checking-for-image.md
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
# Invalid
|
||||
|
||||

|
3
test/fixtures/invalid/ignore-name-fragment-if-not-an-anchor/awesome.md
vendored
Normal file
3
test/fixtures/invalid/ignore-name-fragment-if-not-an-anchor/awesome.md
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
# Awesome
|
||||
|
||||
<input name="name-should-be-ignored" id="id-after-name" />
|
@ -0,0 +1,3 @@
|
||||
# Invalid
|
||||
|
||||
[Invalid](./awesome.md#name-should-be-ignored)
|
3
test/fixtures/invalid/ignore-not-an-id-fragment/awesome.md
vendored
Normal file
3
test/fixtures/invalid/ignore-not-an-id-fragment/awesome.md
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
# Awesome
|
||||
|
||||
<div data-id="not-an-id-should-be-ignored">Content</div>
|
3
test/fixtures/invalid/ignore-not-an-id-fragment/ignore-not-an-id-fragment.md
vendored
Normal file
3
test/fixtures/invalid/ignore-not-an-id-fragment/ignore-not-an-id-fragment.md
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
# Invalid
|
||||
|
||||
[Invalid](./awesome.md#not-an-id-should-be-ignored)
|
3
test/fixtures/invalid/non-existing-anchor-name-fragment/awesome.md
vendored
Normal file
3
test/fixtures/invalid/non-existing-anchor-name-fragment/awesome.md
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
# Awesome
|
||||
|
||||
<a name="existing-heading-anchor">Link</a>
|
3
test/fixtures/invalid/non-existing-anchor-name-fragment/non-existing-anchor-name-fragment.md
vendored
Normal file
3
test/fixtures/invalid/non-existing-anchor-name-fragment/non-existing-anchor-name-fragment.md
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
# Invalid
|
||||
|
||||
[Link fragment](./awesome.md#non-existing-anchor-name-fragment)
|
3
test/fixtures/invalid/non-existing-element-id-fragment/awesome.md
vendored
Normal file
3
test/fixtures/invalid/non-existing-element-id-fragment/awesome.md
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
# Awesome
|
||||
|
||||
<div id="existing-element-id-fragment">Content</div>
|
3
test/fixtures/invalid/non-existing-element-id-fragment/non-existing-element-id-fragment.md
vendored
Normal file
3
test/fixtures/invalid/non-existing-element-id-fragment/non-existing-element-id-fragment.md
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
# Invalid
|
||||
|
||||
[Link fragment](./awesome.md#non-existing-element-id-fragment)
|
@ -1,5 +1,3 @@
|
||||
# Valid
|
||||
|
||||
<a name="existing-heading-anchor" ></a>
|
||||
# Awesome
|
||||
|
||||
## Existing Heading
|
||||
|
@ -1,5 +1,3 @@
|
||||
# Invalid
|
||||
|
||||
[Link fragment](./awesome.md#non-existing-heading)
|
||||
|
||||
[Link fragment](./awesome.md#non-existing-heading-anchor)
|
||||
|
3
test/fixtures/valid/existing-anchor-name-fragment/awesome.md
vendored
Normal file
3
test/fixtures/valid/existing-anchor-name-fragment/awesome.md
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
# Awesome
|
||||
|
||||
<a name="existing-heading-anchor">Link</a>
|
3
test/fixtures/valid/existing-anchor-name-fragment/existing-anchor-name-fragment.md
vendored
Normal file
3
test/fixtures/valid/existing-anchor-name-fragment/existing-anchor-name-fragment.md
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
# Invalid
|
||||
|
||||
[Link fragment](./awesome.md#existing-heading-anchor)
|
3
test/fixtures/valid/existing-element-id-fragment/awesome.md
vendored
Normal file
3
test/fixtures/valid/existing-element-id-fragment/awesome.md
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
# Awesome
|
||||
|
||||
<div id="existing-element-id-fragment">Content</div>
|
3
test/fixtures/valid/existing-element-id-fragment/existing-element-id-fragment.md
vendored
Normal file
3
test/fixtures/valid/existing-element-id-fragment/existing-element-id-fragment.md
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
# Invalid
|
||||
|
||||
[Link fragment](./awesome.md#existing-element-id-fragment)
|
@ -1,7 +1,5 @@
|
||||
# Valid
|
||||
|
||||
<a name="existing-heading-anchor" ></a>
|
||||
|
||||
## Existing Heading
|
||||
|
||||
### Repeated Heading
|
||||
|
@ -2,8 +2,6 @@
|
||||
|
||||
[Link fragment](./awesome.md#existing-heading)
|
||||
|
||||
[Link fragment](./awesome.md#existing-heading-anchor)
|
||||
|
||||
[Link fragment Repeated 0](./awesome.md#repeated-heading)
|
||||
|
||||
[Link fragment Repeated 1](./awesome.md#repeated-heading-1)
|
||||
|
2
test/fixtures/valid/existing-image.md
vendored
2
test/fixtures/valid/existing-image.md
vendored
@ -1,3 +1,3 @@
|
||||
# Valid
|
||||
|
||||

|
||||

|
||||
|
5
test/fixtures/valid/ignore-fragment-checking-in-own-file.md
vendored
Normal file
5
test/fixtures/valid/ignore-fragment-checking-in-own-file.md
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
# Valid
|
||||
|
||||
<div id="existing-element-id-fragment">Content</div>
|
||||
|
||||
[Link fragment](#non-existing-element-id-fragment)
|
Reference in New Issue
Block a user