You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the starlight-heading-badges plugin and referencing the heading with a badge from elsewhere in docs, the starlight-links-validator plugin fails with a validation error.
To Reproduce
Setup the starlight-heading-badges plugin and create a heading with a badge: ## Hello :badge[New].
Reference the heading in the current document or another page. For example, [click](#hello) or [click](/guides/example/#hello).
Run the build to see the error:
validating links 11:59:41 [ERROR] ✗ Found 1 invalid link in 1 file.11:59:41 ▶ /11:59:41 └─ /guides/example/#hello - invalid hash[AstroUserError] Links validation failed.
I also tried ## Hello:badge[New] (without the space), but the result is the same.
I guess it could be related to the same problem described in the #72 PR.
andrii-bodnar
changed the title
Validation error when using the starlight-heading-badges plugin
Validation error when using the starlight-heading-badges plugin
Nov 30, 2024
I initially thought like you that could be related to #72 but turns out I was wrong. Both plugins internally use remark plugins and the starlight-heading-badges one does some changes on the heading IDs that cannot be picked up by the starlight-links-validator one if it's not executed after the first one.
In this case, changing the order of the plugins in the Astro config should fix the issue:
Describe the bug
When using the
starlight-heading-badges
plugin and referencing the heading with a badge from elsewhere in docs, thestarlight-links-validator
plugin fails with a validation error.To Reproduce
starlight-heading-badges
plugin and create a heading with a badge:## Hello :badge[New]
.[click](#hello)
or[click](/guides/example/#hello)
.I also tried
## Hello:badge[New]
(without the space), but the result is the same.Expected behavior
No validation error.
How often does this bug happen?
Every time
System Info
No response
Additional Context
Minimal reproducible example (Stackblitz)
The text was updated successfully, but these errors were encountered: