fix(docs): emit catalog source accordion titles as plain strings - #4006
Merged
Merged
Conversation
The generated catalog pages rendered the "Source" accordion title as a
JSX expression, `<Accordion title={`name.html`}>`. Mintlify's search
indexer stringifies expression attribute nodes rather than evaluating
them, so every one of the 399 catalog pages surfaced its Source section
in search results as "[object Object]" (visible on the Scroll Feed page,
among others).
The template literal carried no escaping benefit: every title is a
single-segment `name.html` path, and a double-quoted JSX string handles
it directly. Introduce `mdxStringAttribute`, which emits a plain
`name="value"` attribute and escapes `& " < { }` as HTML character
references (MDX decodes references inside quoted attribute values, and
unlike JSON.stringify it does not rely on backslash escapes, which JSX
strings do not honour). Use it for both the Source accordion title and
the preview iframe title, and regenerate the catalog pages.
Regenerated with `npx tsx scripts/generate-catalog-pages.ts`; the only
change across the 399 pages is the one Accordion title line each.
Co-Authored-By: Miguel Ángel <miguel.sierra@heygen.com>
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Automations to automatically generate PRs for you. |
miguel-heygen
approved these changes
Sep 16, 2026
Merged
miga-heygen
added a commit
that referenced
this pull request
Sep 16, 2026
- Portrait compositions render the full frame when the project was scaffolded at a different size: html/body are sized to the composition root at runtime; new lint warning root_dimensions_mismatch (#4005, fixes #4001) - render_complete telemetry adds composition_element_tags, aroll_video_count, heygen_video_count; render_error adds error_name and failed_stage_code (#4004) - Catalog docs "Source" accordion titles are plain strings, so docs search no longer shows [object Object] (#4006) Co-Authored-By: Miguel Ángel <miguel.sierra@heygen.com>
miguel-heygen
added a commit
that referenced
this pull request
Sep 16, 2026
- Portrait compositions render the full frame when the project was scaffolded at a different size: html/body are sized to the composition root at runtime; new lint warning root_dimensions_mismatch (#4005, fixes #4001) - render_complete telemetry adds composition_element_tags, aroll_video_count, heygen_video_count; render_error adds error_name and failed_stage_code (#4004) - Catalog docs "Source" accordion titles are plain strings, so docs search no longer shows [object Object] (#4006) Co-authored-by: Miguel Ángel <miguel.sierra@heygen.com>
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.
Root cause
scripts/generate-catalog-pages.tsemitted the "Source" section heading of every catalog page as a JSX expression:Mintlify's search indexer stringifies expression attribute nodes instead of evaluating them, so the section title showed up in docs search as
[object Object](reproducible on the Scroll Feed page, but the same line is on all 399 pages underdocs/catalog/**).Git history (
git log -S 'title={') shows the template literal arrived with the #3090 catalog port and was never motivated by an escaping need: every value is a single-segmentname.html` path, so a plain double-quoted string is the correct form — the same form the generator already used for the "The prompt this was built from" accordion.Fix
mdxStringAttribute(name, value)helper emitsname="value"and escapes& " < { }as HTML character references (MDX decodes references inside quoted attribute values; JSON.stringify was not an option because JSX strings do not honour backslash escapes).<Accordion>and the preview<iframe title=...>(which previously usedJSON.stringify; its output is byte-identical for every existing item, so no iframe lines changed).& " < { }, and backticks passing through untouched.Regeneration
bun install --frozen-lockfile && npx tsx scripts/generate-catalog-pages.ts. Running the generator on an unmodified checkout first produced zero changes, so everything in this diff is attributable to the generator change.Verification
grep -rlE 'title=\{' docs --include=*.mdx | wc -l`: 399 before → 0 aftergrep -rl '<Accordion title="[a-z0-9-]*\.html">' docs --include=*.mdx | wc -l: 0 before → 399 aftergit diff --stat -- docs: 399 files, 399 insertions, 399 deletions — exactly one Accordion title line per page, nothing elsenode --import tsx --test scripts/generate-catalog-pages.test.ts: new tests pass; the one failing case (explorer producer) fails identically onmainand is unrelated to this changeoxfmt --checkandoxlintclean on both touched scripts;scripts/check-docs-snippet-motion.mjspassesdocs/**/*.mdxfor any othertitle={/label={expression attributes: none remain besides this pattern. Component props insidedocs/snippets/*.jsx(title={title}) are React runtime props, not MDX attributes, and are not indexed.