Skip to content

fix(cli): render bold markdown in hyperframes docs - #7327

Closed
RClaudiuM wants to merge 1 commit into
heygen-com:mainfrom
RClaudiuM:fix/docs-render-bold
Closed

RClaudiuM wants to merge 1 commit into
heygen-com:mainfrom
RClaudiuM:fix/docs-render-bold

Conversation

@RClaudiuM

Copy link
Copy Markdown

What

hyperframes docs <topic> renders **bold** spans instead of printing the literal ** markers.

Why

hyperframes docs compositions printed **data-composition-variables** and **array of declarations** as-is: the terminal markdown renderer in packages/cli/src/commands/docs.ts handled headings, bullets and backtick spans, but not bold.

Related work

Fixes #7277

How

formatInlineCode became formatInline: after the backtick replacement it replaces **text** with c.bold(text), the same colour helper the headings use, so a TTY gets bold text and a non-TTY (or NO_COLOR) gets the plain text with the markers removed, matching how the renderer already treats code spans. A lone ** with nothing between the pairs on one line is left alone. The per-line rendering moved into an exported renderMarkdownLines(content) that returns the lines, and renderMarkdown prints them, so the test can assert on the output without capturing console.log.

Test plan

  • Unit tests added/updated: three cases in docs.test.ts (a bold span renders without ** and keeps its text; bold inside a list item and next to inline code; a bare 2 ** 3 line is unchanged). npx vitest run src/commands/docs.test.ts in packages/cli: 6 passed.
  • Manual testing performed: oxlint and oxfmt clean on both files; node scripts/check-comment-citations.mjs and node scripts/comment-ratchet.mjs report nothing to flag; docs.ts has no new comment blocks.
  • Documentation updated (if applicable): not needed.
  • Comments follow CONTRIBUTING.md "Comments": the one comment edited names the two replacements in order; the bug and its reproduction are in this description.

The terminal renderer in docs.ts handled headings, bullets and backtick spans but not **bold**, so `hyperframes docs compositions` printed the literal markers. Bold spans now go through the colour helper like code spans, so a TTY shows bold text and a non-TTY shows the text without the markers. The line rendering is exported as renderMarkdownLines so the test can read it.

Fixes heygen-com#7277
@jrusso1020

Copy link
Copy Markdown
Collaborator

Thanks for contributing. I selected #7281 for this issue because its regression renders the actual compositions topic and pins the original bold-around-code example. Closing this overlapping submission so the issue has one implementation to take through CI and merge: #7281. Your work remains available in this PR.

@jrusso1020 jrusso1020 closed this Nov 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

hyperframes docs prints literal ** bold markers

2 participants