Files
Anthony ShewandGitHub ad022dec67 fix: Strip JSX components from heading anchors and TOC entries (#12404)
## Summary

- Heading anchor IDs and TOC entries included text from inline JSX
components (like `<ExperimentalBadge>`), producing anchors like
`#boundaries-experimental` and cluttered TOC sidebars
- Adds a rehype plugin (`rehype-strip-heading-jsx`) that runs between
`remarkHeading` and `rehypeToc` in the fumadocs pipeline to strip JSX
from heading IDs and TOC titles while preserving badge rendering in the
heading itself
- Removes brittle badge-specific workarounds from the link checker

## How it works

The rehype plugin intercepts heading elements after `remarkHeading` sets
IDs but before `rehypeToc` reads them:

1. Rewrites the heading `id` without JSX text content
2. Removes JSX elements from heading children (so `rehypeToc` produces
clean TOC titles)
3. Serializes the removed JSX as a `data-heading-badges` attribute

The `HeadingWithBadges` component reads this attribute and re-injects
the badge components inline at render time. Badges appear in the heading
but never reach the TOC or anchor ID.

## Testing

Visit `/docs/reference/configuration` and verify:
- Heading anchors are clean (e.g., `#affectedusingtaskinputs` not
`#affectedusingtaskinputs-pre-release`)
- TOC sidebar entries don't include badge text
- Badges still render inline in the heading content
- Blog posts with anchor links to badge headings still navigate
correctly (`/blog/turbo-2-4`, `/blog/turbo-2-2-0`, `/blog/turbo-1-9-0`)
2026-03-20 13:00:58 -06:00
..

GitHub Action for Validating Documentation Links

This action ensures that internal links in .mdx files in the /docs/ directory are valid. It runs on every pull request that includes changes to these files.

The action is triggered by the workflow defined in .github/workflows/docs.yml.

Usage

pnpm check-links