[DX-998] fix: remove spurious # from anchor IDs and harden headers hook#3305
Merged
jamiehenson merged 1 commit intomainfrom Mar 31, 2026
Merged
[DX-998] fix: remove spurious # from anchor IDs and harden headers hook#3305jamiehenson merged 1 commit intomainfrom
jamiehenson merged 1 commit intomainfrom
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
73 MDX headings across 5 API/getting-started pages had `<a id="#foo"/>` instead of `<a id="foo"/>`, causing the literal `#` to appear in the HTML id attribute. This broke in-page fragment links and caused the copyable header hook to produce double-hash hrefs (`##foo`). - Strip leading `#` from all affected `<a id="...">` tags in content - Defensively strip any leading `#` from id values in useCopyableHeaders to prevent recurrence if the pattern reappears in content Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
b0ad82a to
fc30aff
Compare
647b7c8 to
fc30aff
Compare
kennethkalmer
approved these changes
Mar 31, 2026
Member
kennethkalmer
left a comment
There was a problem hiding this comment.
#goodcatch @jamiehenson!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Human preamble
@SimonWoolf raised some broken internal anchor links in docs content here. This is actually fairly widespread, and is largely an MDX content issue - HTML
idattributes should not include '#' characters.This PR fixes incorrect id syntax in the MDX assets themselves (additional '#' characters), and allows the UI components to catch future issues.
Summary
api/realtime-sdk/authentication,api/realtime-sdk/types,api/rest-sdk/types,getting-started/flutter,getting-started/react-native) had<a id="#foo"/>instead of<a id="foo"/>. The literal#ended up as part of the HTMLidattribute value, so fragment links like[text](#foo)found no matching element.useCopyableHeadershook insrc/components/Layout/mdx/headers.tscompounded the issue by prepending another#when building the copyable-link href, producing##foo.#from all 73 affected anchor tags, and adding a defensive strip in the hook so the same breakage cannot recur if the pattern reappears in content.Test plan
#tokens,#auth-object,#authorize) navigate correctly…/authentication#tokensnot…/authentication##tokens)api/realtime-sdk/typesandapi/rest-sdk/typesfor the same🤖 Generated with Claude Code