Skip to content

Commit 0ff4a9b

Browse files
HTML encode dollar sign in schema reference (modelcontextprotocol#1485)
Mintlify's Markdown parser treats dollar signs as special characters in some cases. The exact cause is not clear, but it might be related to MDX's [LaTeX support](https://mdxjs.com/guides/math/). An example of this behavior can be seen in the build failure for [modelcontextprotocol#881][], in which `npm run check:docs:links` failed to parse `schema.mdx` due to newly introduced `$schema` properties. This commit modifies the `schema.mdx` generator to HTML encode dollar signs, thus preventing such parse errors. [modelcontextprotocol#881]: modelcontextprotocol#881
1 parent 46e3277 commit 0ff4a9b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

typedoc.plugin.mjs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,9 @@ function renderReflection(reflection, context) {
167167
replaceAll(/\n+</g, " <"). // Newlines around tags are not significant
168168
replaceAll("[", "&#x5B;"). // `[` inside HTML tags != link
169169
replaceAll("_", "&#x5F;"). // `_` inside HTML tags != emphasis
170-
replaceAll("{", "&#x7B;"); // Plain *.md is not supported, so must escape JSX interpolation
170+
replaceAll("{", "&#x7B;"). // Plain *.md is not supported, so must escape JSX interpolation
171+
replaceAll("$", "&#x24;"); // `$` does not demarcate LaTeX(?)
172+
171173

172174
// Remove `@TJS-type` tags. (Ideally, we would include this tag in
173175
// `excludeTags`, but a TypeDoc bug rejects tag names with dashes.)

0 commit comments

Comments
 (0)