Skip to content

Fix hidden heading anchor links - #4167

Merged
delucis merged 2 commits into
withastro:mainfrom
HiDeoo:hd/fix-heading-links-hidden
Sep 1, 2026
Merged

delucis merged 2 commits into
withastro:mainfrom
HiDeoo:hd/fix-heading-links-hidden

Conversation

@HiDeoo

@HiDeoo HiDeoo commented Sep 1, 2026 •

Copy link
Copy Markdown
Member

Description

This PR fixes an issue with anchor links and hidden headings (e.g. footnote headings).

This PR does not use the approach from #4166 to prevent heading links to be added at the Markdown processor level:

  • A user could have some custom CSS or client-side JS to show such headings at some point in time
  • The issue also appears when using the <AnchorHeading> component

Instead, this PR uses CSS to properly hide anchor links for hidden headings.

Remaining tasks

  • Address all TODO(HiDeoo) comments

@changeset-bot

changeset-bot Bot commented Sep 1, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 203f9f6

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@astrojs/starlight Patch

Not sure what this means? Click here to learn what changesets are.

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

@netlify

netlify Bot commented Sep 1, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for astro-starlight ready!

Name Link
🔨 Latest commit 203f9f6
🔍 Latest deploy log https://app.netlify.com/projects/astro-starlight/deploys/6a96f61d23f12e0008d379b7
😎 Deploy Preview https://deploy-preview-4167--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
🤖 Make changes Run an agent on this branch

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

@astrobot-houston

Copy link
Copy Markdown
Contributor

Lunaria Status Overview

🌕 This pull request will trigger status changes.

Learn more

By default, every PR changing files present in the Lunaria configuration's files property will be considered and trigger status changes accordingly.

You can change this by adding one of the keywords present in the ignoreKeywords property in your Lunaria configuration file in the PR's title (ignoring all files) or by including a tracker directive in the merged commit's description.

Tracked Files

Locale File Note
en getting-started.mdx Source changed, localizations will be marked as outdated.
Warnings reference
Icon Description
🔄️ The source for this localization has been updated since the creation of this pull request, make sure all changes in the source have been applied.

@github-actions github-actions Bot added 📚 docs Documentation website changes 🌟 core Changes to Starlight’s main package labels Sep 1, 2026

@delucis delucis left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Except for cleaning up the TODO this fix looks correct to me!

Comment thread docs/src/content/docs/getting-started.mdx Outdated
Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
@codspeed

codspeed Bot commented Sep 1, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 2 untouched benchmarks


Comparing HiDeoo:hd/fix-heading-links-hidden (203f9f6) with main (dd7fb97)

Open in CodSpeed

@delucis
delucis merged commit 32a5e29 into withastro:main Sep 1, 2026
18 checks passed
@astrobot-houston astrobot-houston mentioned this pull request Sep 1, 2026
HiDeoo added a commit to HiDeoo/starlight that referenced this pull request Sep 2, 2026
* main:
  [i18nIgnore] Transpile Starlight packages (withastro#3572)
  i18n(ru): update translations (withastro#4170)
  [ci] release (withastro#4169)
  Fix hidden heading anchor links (withastro#4167)
  perf: optimize route and sidebar lookups (withastro#4148)
  chore: add benchmarks (withastro#4157)
dadezzz pushed a commit to dadezzz/university_notes that referenced this pull request Sep 5, 2026
This PR contains the following updates:

| Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) |
|---|---|---|---|
| [@astrojs/starlight](https://starlight.astro.build) ([source](https://github.com/withastro/starlight/tree/HEAD/packages/starlight)) | [`0.41.10` → `0.41.11`](https://renovatebot.com/diffs/npm/@astrojs%2fstarlight/0.41.10/0.41.11) | ![age](https://developer.mend.io/api/mc/badges/age/npm/@astrojs%2fstarlight/0.41.11?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@astrojs%2fstarlight/0.41.10/0.41.11?slim=true) |

---

### Release Notes

<details>
<summary>withastro/starlight (@&#8203;astrojs/starlight)</summary>

### [`v0.41.11`](https://github.com/withastro/starlight/blob/HEAD/packages/starlight/CHANGELOG.md#04111)

[Compare Source](https://github.com/withastro/starlight/compare/@astrojs/starlight@0.41.10...@astrojs/starlight@0.41.11)

##### Patch Changes

- [#&#8203;4167](withastro/starlight#4167) [`32a5e29`](withastro/starlight@32a5e29) Thanks [@&#8203;HiDeoo](https://github.com/HiDeoo)! - Fixes a layout issue and anchor links appearing for hidden headings, e.g. footnote headings, when `markdown.headingLinks` is enabled or the `<AnchorHeading>` component is used.

- [#&#8203;4148](withastro/starlight#4148) [`cdfafd8`](withastro/starlight@cdfafd8) Thanks [@&#8203;ematipico](https://github.com/ematipico)! - Optimizes sidebar data generation logic to speed up sites with large sidebars

</details>

---

### Configuration

📅 **Schedule**: (UTC)

- Branch creation
  - At any time (no schedule defined)
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Mend Renovate CLI](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC42MS42IiwidXBkYXRlZEluVmVyIjoiNDQuNjEuNiIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->
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 📚 docs Documentation website changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Anchor for Footnotes becomes visible on hover, even though the Footnotes heading is not

3 participants