Skip to content

Fix MDX parsing by escaping curly braces in JSDoc comment#174

Merged
Jesse Seldess (jseldess) merged 1 commit intomainfrom
fix-mdx-parsing-in-jsdoc
Feb 20, 2026
Merged

Fix MDX parsing by escaping curly braces in JSDoc comment#174
Jesse Seldess (jseldess) merged 1 commit intomainfrom
fix-mdx-parsing-in-jsdoc

Conversation

@jseldess
Copy link
Contributor

Summary

Escapes {{ and {% in the JSDoc comment for templateUsesThreadVariables to prevent them from being interpreted as JSX expressions when generating MDX documentation.

Problem

The TypeScript reference docs (versions 0.0.131 and 0.0.132) were failing to parse with the error:

Unexpected end of file in expression, expected a corresponding closing brace for `{`

This was caused by unescaped curly braces in the JSDoc comment at line 48 of js/llm.ts.

Solution

Wrapped the template syntax examples in backticks to make them inline code, which prevents the MDX parser from treating them as JSX expressions.

Testing

After this fix is merged and the submodule is updated in the braintrust repo, the docs will need to be regenerated using:

make docs-libraries

🤖 Generated with Claude Code

Escape {{ and {% in the JSDoc comment for templateUsesThreadVariables
to prevent them from being interpreted as JSX expressions when generating
MDX documentation.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@github-actions
Copy link

github-actions bot commented Feb 20, 2026

Braintrust eval report

Autoevals (fix-mdx-parsing-in-jsdoc-1771619907)

Score Average Improvements Regressions
NumericDiff 74.1% (0pp) - 1 🔴
Time_to_first_token 1.35tok (-0.02tok) 55 🟢 64 🔴
Llm_calls 1.55 (+0) - -
Tool_calls 0 (+0) - -
Errors 0 (+0) - -
Llm_errors 0 (+0) - -
Tool_errors 0 (+0) - -
Prompt_tokens 279.25tok (+0tok) - -
Prompt_cached_tokens 0tok (+0tok) - -
Prompt_cache_creation_tokens 0tok (+0tok) - -
Completion_tokens 18.45tok (+0tok) - -
Completion_reasoning_tokens 0tok (+0tok) - -
Total_tokens 297.7tok (+0tok) - -
Estimated_cost 0$ (+0$) - -
Duration 3.43s (+0.47s) 83 🟢 136 🔴
Llm_duration 2.81s (+0.03s) 36 🟢 83 🔴

@jseldess Jesse Seldess (jseldess) merged commit d78f4ab into main Feb 20, 2026
7 checks passed
@jseldess Jesse Seldess (jseldess) deleted the fix-mdx-parsing-in-jsdoc branch February 20, 2026 22:25
@github-actions
Copy link

github-actions bot commented Feb 20, 2026

Braintrust eval report

Autoevals (main-1771626348)

Score Average Improvements Regressions
NumericDiff 73.2% (-1pp) 2 🟢 4 🔴
Time_to_first_token 1.35tok (-0.08tok) 85 🟢 34 🔴
Llm_calls 1.55 (+0) - -
Tool_calls 0 (+0) - -
Errors 0 (+0) - -
Llm_errors 0 (+0) - -
Tool_errors 0 (+0) - -
Prompt_tokens 279.25tok (+0tok) - -
Prompt_cached_tokens 0tok (+0tok) - -
Prompt_cache_creation_tokens 0tok (+0tok) - -
Completion_tokens 18.45tok (+0tok) - -
Completion_reasoning_tokens 0tok (+0tok) - -
Total_tokens 297.7tok (+0tok) - -
Estimated_cost 0$ (+0$) - -
Duration 3.16s (-0.06s) 116 🟢 103 🔴
Llm_duration 2.8s (-0.08s) 78 🟢 41 🔴

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.

2 participants