docs: fix six broken hook anchor links - #2519
Conversation
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/.
There was a problem hiding this comment.
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 indocs/hooks/session-lifecycle.md - Retarget six inbound links to the GitHub-flavored Markdown generated slugs in
docs/hooks/hooks-overview.mdanddocs/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
left a comment
There was a problem hiding this comment.
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.
Summary
docs/hooks/session-lifecycle.mdis the only file indocs/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-endor#agent-stoplands at the top of the page instead of the section.Six links are affected:
docs/features/hooks.md-onSessionStart,onSessionEnddocs/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:Prose and links only, no code blocks touched, so
docs-validateis unaffected.