Skip to content

Conversation

@delucis
Copy link
Member

@delucis delucis commented Jan 15, 2026

Description

This PR fixes an issue with Starlight’s intersection observer used for updating table of contents state, which we discovered while reviewing #3382 during Talking & Doc’ing today.

We found multiple issues:

  • After we added anchor link support, headings in sites with this enabled are wrapped in a <div> breaking an assumption in the table of contents logic.
  • After moving Markdown styles to an external CSS file, we renamed .content to .sl-markdown-content, but forgot to rename the same in a query selector here.

This caused some subtle issues that were not super obvious, but we noticed them while digging deeper.

@changeset-bot
Copy link

changeset-bot bot commented Jan 15, 2026

⚠️ No Changeset found

Latest commit: c6c4f69

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@netlify
Copy link

netlify bot commented Jan 15, 2026

Deploy Preview for astro-starlight ready!

Name Link
🔨 Latest commit c6c4f69
🔍 Latest deploy log https://app.netlify.com/projects/astro-starlight/deploys/696ac9b7c829640008354205
😎 Deploy Preview https://deploy-preview-3656--astro-starlight.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 100 (no change from production)
Accessibility: 100 (no change from production)
Best Practices: 100 (no change from production)
SEO: 100 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions github-actions bot added the 🌟 core Changes to Starlight’s main package label Jan 15, 2026
@astrobot-houston
Copy link
Contributor

astrobot-houston commented Jan 15, 2026

size-limit report 📦

Path Size
/index.html 7.28 KB (0%)
/_astro/*.js 25.87 KB (+0.41% 🔺)
/_astro/*.css 14.3 KB (0%)

- Correctly highlights “Overview” for content preceding first subheading (this was incorrectly being attributed *to* the first subheading in our updated code in the previous commit
- Correctly selects elements for observation to avoid excluding elements that include an `id`’d element which isn’t a heading (e.g. tabs)
- Fixes returning headings from `getHeadingElement()` that aren’t in the ToC, a bug introduced in the previous commit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🌟 core Changes to Starlight’s main package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants