Skip to content

fix(docs): escape double quotes in Mintlify accordion example titles#1015

Merged
mbevc1 merged 1 commit into
mainfrom
20260710_fix_docs
Jul 10, 2026
Merged

fix(docs): escape double quotes in Mintlify accordion example titles#1015
mbevc1 merged 1 commit into
mainfrom
20260710_fix_docs

Conversation

@mbevc1

@mbevc1 mbevc1 commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

The generated MDX for a command whose example comment contains double quotes (e.g. 'kosli list controls' with: # list controls whose name or identifier contains "sdlc") produced an invalid JSX attribute:

<Accordion title="... contains "sdlc"">

which breaks the Mintlify build for that page, so the page fails to render and its BETA sidebar tag is lost. Replace double quotes with single quotes when writing accordion titles.

The generated MDX for a command whose example comment contains double
quotes (e.g. 'kosli list controls' with: # list controls whose name or
identifier contains "sdlc") produced an invalid JSX attribute:

  <Accordion title="... contains "sdlc"">

which breaks the Mintlify build for that page, so the page fails to
render and its BETA sidebar tag is lost. Replace double quotes with
single quotes when writing accordion titles.
@mbevc1 mbevc1 added bug Something isn't working documentation Improvements or additions to documentation labels Jul 10, 2026
@claude

claude Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Claude finished @mbevc1's task in 1m 11s —— View job


Review: PR #1015 — escape double quotes in Mintlify accordion titles

  • Read changed files and surrounding code
  • Run static analysis (build, vet)
  • Review the fix and tests
  • Post review

Verdict: LGTM. Clean, minimal, well-targeted fix with a matching regression test.

What the fix does

internal/docgen/mintlify.go:125 replaces " with ' in the accordion title before it's interpolated into the JSX title="..." attribute. A raw double quote would terminate the attribute early and produce malformed MDX (the <Accordionsdlc""> breakage described in the PR), which fails the Mintlify build for that page.

Strengths

  • Consistent with existing conventions — the same substitution already lives in sanitizeDescription (mintlify.go:144), so this follows the established pattern rather than inventing a new one.
  • Good regression testTestMintlifyExampleUseCasesEscapesQuotesInTitle uses the exact real-world example from the bug report and asserts both the positive (single quotes present) and negative (no raw double quotes) conditions.
  • Correct placement — the replacement runs before the title[1:] slice and interpolation, so the whole title is sanitized.

Static analysis

Check Result
go build ./internal/docgen/... ✅ pass
go vet ./internal/docgen/... ✅ pass
go test ./internal/docgen/... ⚠️ not run — test execution requires approval in this environment

I couldn't execute the test suite here due to tool permissions; build and vet are clean. Please confirm CI is green.

Minor (non-blocking)

The title could theoretically also be broken by other JSX-significant characters ({, }, unescaped <). Those aren't in the reported failure and are rare in example comments, so scoping this PR to double quotes is fine — flagged inline in case a future example hits them.

Comment thread internal/docgen/mintlify.go
@mbevc1 mbevc1 enabled auto-merge (squash) July 10, 2026 11:30
@mbevc1 mbevc1 merged commit 106abc0 into main Jul 10, 2026
20 checks passed
@mbevc1 mbevc1 deleted the 20260710_fix_docs branch July 10, 2026 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants