Repository navigation
fix(schema-generator): keep braces unescaped in inline code - #3045
Open
connorburgess wants to merge 1 commit into
Open
connorburgess wants to merge 1 commit into
connorburgess wants to merge 1 commit into
Conversation
The reference generator escapes braces in descriptions because MDX
reads them as an expression. It also escaped them inside inline code,
where a backslash is literal, so the published reference shows
`\{\}` wherever a description says that supplying `{}` advertises
a capability. The v1 reference page has 29 such lines.
Track inline code while escaping and leave braces alone inside it.
Prose braces, pipes and angle brackets are escaped as before.
Regenerated the four reference pages. Besides the removed backslashes,
Prettier now reformats a few fields it previously left alone, since it
can parse them. Their text is unchanged. Published JSON Schemas are
unchanged.
Preview approval requiredThis pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit |
This branch has not been deployed
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.
Problem
The reference generator escapes
{and}in descriptions, because MDX reads braces as an expression. It also escapes them inside inline code, where a backslash is literal. The published reference therefore shows\{\}wherever a description says that supplying{}advertises a capability.It is visible today on https://agentclientprotocol.com/protocol/v1/schema, for example under
sessionCapabilities: the v1 page has 29 such lines.Change
escape_mdxinschema-generator/src/main.rsnow tracks inline code and leaves braces alone inside it. Braces in prose, pipes and angle brackets are escaped as before.The four reference pages are regenerated. No
\{remains in any of them. Prettier also reformats a few fields that it could not parse before; their text is unchanged. The published JSON Schemas are unchanged.Hand-written pages already use
{}inside inline code within the same components (for exampledocs/protocol/v1/initialization.mdx), so the generated form matches what already builds.Testing
escape_mdx_keeps_braces_in_inline_codefails before the change and passes after.npm run checkpasses locally (Clippy, format, spellcheck,cargo test --all-features, schema tests).