Repository navigation
Conversation
The h2 heading id was built with props.children?.toString(), which
returns "[object Object]" whenever a heading contains nested markdown
like **bold** or `code`, breaking the anchor id and any deep link or
table-of-contents jump to that heading. It also only stripped spaces,
apostrophes, and question marks, leaving other punctuation (":", ",",
"(", ")", "/") in the generated id.
Walk the children tree to collect plain text first, then slugify it
properly (lowercase, strip non-alphanumeric characters, collapse to
hyphens) so the id is always a valid, predictable anchor regardless
of what inline formatting the heading uses.
|
@zigzagdev is attempting to deploy a commit to the product-studio Team on Vercel. A member of the Team first needs to authorize it. |
Yeom-JinHo
self-requested a review
October 5, 2026 08:15
Member
|
Thanks @zigzagdev! Closing since this doesn't reproduce: fumadocs' |
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.
Description
The
h2heading id was built withprops.children?.toString(), which returns "[object Object]" whenever a heading contains nested markdown like bold orcode, breaking the anchor id and any deep link or table-of-contents jump to that heading.It also only stripped spaces, apostrophes, and question marks, leaving other punctuation (:, ,, (, ), /) in the generated id.
This PR walks the children tree to extract plain text first, then slugifies it properly.
Changes
getHeadingText()to recursively extract plain text from a heading's React children treeslugifyHeading()to normalize that text into a safe, predictable anchor id (lowercase, strip non-alphanumeric characters, collapse whitespace to hyphens)h2MDX component'sidgeneration instead ofprops.children?.toString()Motivation
At least two live blog posts have h2 headings wrapped in bold, which rendered their anchor id as the literal string
object-object, breaking deep links and table-of-contents navigation to those sections.Headings with other punctuation (colons, parentheses, commas, slashes) — 66 across docs/blog — also produced invalid or unpredictable ids.
So, this fix makes heading id generation robust regardless of inline formatting.
Breaking Changes
None
Screenshots
Not applicable
Checklist
pnpm checkpasses locallypnpm buildpasses locallypnpm build:registrywas run and the generated files are committed (if you changedregistry/orconfig/site.ts— CI verifies this on every PR)feat(marquee): add reverse prop)