-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: adds a new
errorOnInvalidHashes
option defaulting to true
t…
…o disable hash validation
- Loading branch information
Showing
24 changed files
with
373 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
...ges/starlight-links-validator/tests/fixtures/invalid-hashes-invalid-links/astro.config.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import starlight from '@astrojs/starlight' | ||
import { defineConfig } from 'astro/config' | ||
|
||
import starlightLinksValidator from '../..' | ||
|
||
export default defineConfig({ | ||
integrations: [ | ||
starlight({ | ||
plugins: [starlightLinksValidator({ errorOnInvalidHashes: false })], | ||
title: 'Starlight Links Validator Tests - invalid hashes invalid links', | ||
}), | ||
], | ||
}) |
46 changes: 46 additions & 0 deletions
46
...tests/fixtures/invalid-hashes-invalid-links/src/content/docs/guides/example.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
--- | ||
title: Example | ||
--- | ||
|
||
import { Card, CardGrid, LinkCard, LinkButton } from '@astrojs/starlight/components' | ||
|
||
## Steps | ||
|
||
<CardGrid stagger> | ||
<Card title="Step 1">Do something</Card> | ||
<Card title="Step 2">Do something else</Card> | ||
</CardGrid> | ||
|
||
## Some links | ||
|
||
- [Link to invalid hash in the same page](#links) | ||
- [Link to invalid hash in another page](/unknown/#links) | ||
|
||
<a href="/unknown">HTML link to unknown page</a> | ||
|
||
<div id="aBlock"> | ||
some content | ||
|
||
some content | ||
|
||
some content | ||
|
||
some content | ||
|
||
<a href="#anotherBlock"> | ||
test | ||
</a> | ||
</div> | ||
|
||
<a href="/icon.svg">Link to invalid asset</a> | ||
<a href="/guidelines/ui.pdf">Link to another invalid asset</a> | ||
|
||
<CardGrid> | ||
<LinkCard title="LinkCard: unknown page" href="/linkcard/" /> | ||
<LinkCard title="LinkCard: unknown page and hash" href="/linkcard/#links" /> | ||
<LinkCard title="LinkCard: unknown hash" href="#linkcard" /> | ||
</CardGrid> | ||
|
||
<LinkButton href="/linkbutton/">LinkButton: unknown page</LinkButton> | ||
<LinkButton href="/linkbutton/#links">LinkButton: unknown page and hash</LinkButton> | ||
<LinkButton href="#linkbutton">LinkButton: unknown hash</LinkButton> |
Oops, something went wrong.