Skip to content

docs: fix six broken hook anchor links - #2519

Merged
SteveSandersonMS merged 1 commit into
github:mainfrom
rinceyuan:docs/fix-session-lifecycle-anchors
Sep 4, 2026
Merged

docs: fix six broken hook anchor links#2519
SteveSandersonMS merged 1 commit into
github:mainfrom
rinceyuan:docs/fix-session-lifecycle-anchors

Conversation

@rinceyuan

Copy link
Copy Markdown
Contributor

Summary

docs/hooks/session-lifecycle.md is the only file in docs/ that uses the explicit heading-id extension:

## Session start hook {#session-start}

GitHub-flavored Markdown does not implement that extension, so the braces render as literal text inside the heading and the id is never created. The generated slug is session-start-hook, which means every link aimed at #session-start, #session-end or #agent-stop lands at the top of the page instead of the section.

Six links are affected:

  • docs/features/hooks.md - onSessionStart, onSessionEnd
  • docs/hooks/hooks-overview.md - onSessionStart, onSessionEnd, onAgentStop (twice)

This drops the three explicit ids and retargets the links at the generated slugs, matching the other 50 files in docs/. It also removes the stray {#...} text from the rendered headings.

Verification

Walked every relative link in docs/ and resolved each target file and anchor against the headings actually present:

  • before: 6 problems, all in these three files
  • after: 0 problems across 51 files

Prose and links only, no code blocks touched, so docs-validate is unaffected.

session-lifecycle.md was the only file in docs/ using the explicit heading-id extension (## Heading {#id}). GitHub's Markdown does not implement it, so the braces render as literal text in the heading and the six links that target those ids resolve to nothing.

Drop the explicit ids and point the links at the generated slugs, matching the other 50 files in docs/.
@rinceyuan
rinceyuan requested a review from a team as a code owner September 4, 2026 06:54
Copilot AI balanced review requested due to automatic review settings September 4, 2026 06:54

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Pull request overview

Removes unsupported explicit heading IDs from session-lifecycle.md and updates inbound links to use GitHub-generated heading slugs so anchor links land on the correct sections.

Changes:

  • Remove {#...} explicit heading-id syntax from three headings in docs/hooks/session-lifecycle.md
  • Retarget six inbound links to the GitHub-flavored Markdown generated slugs in docs/hooks/hooks-overview.md and docs/features/hooks.md

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
docs/hooks/session-lifecycle.md Removes unsupported explicit heading IDs so headings render cleanly and anchors match GFM slugs
docs/hooks/hooks-overview.md Updates links to session lifecycle anchors to point at generated slugs
docs/features/hooks.md Updates links to session lifecycle anchors to point at generated slugs

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@SteveSandersonMS SteveSandersonMS left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approving — this is a clean docs fix. I independently verified the underlying bug (GitHub renders kramdown-style {#id} heading attributes as literal text rather than creating the anchor id) by diffing the live rendered HTML for docs/hooks/session-lifecycle.md before and after your change, and confirmed the new anchors (#session-start-hook, #session-end-hook, #agent-stop-hook) match GitHub's actual generated ids. Scope and diff size look right. Thanks for tracking down all six affected links.

@SteveSandersonMS
SteveSandersonMS added this pull request to the merge queue Sep 4, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Sep 4, 2026
@SteveSandersonMS
SteveSandersonMS added this pull request to the merge queue Sep 4, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Sep 4, 2026
@SteveSandersonMS
SteveSandersonMS merged commit fc4bec5 into github:main Sep 4, 2026
28 checks passed
@rinceyuan
rinceyuan deleted the docs/fix-session-lifecycle-anchors branch September 7, 2026 01:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants