Skip to content

fix(docs): escape MDX JSX openers in generated reference tables#40

Merged
lukaisailovic merged 1 commit into
mainfrom
fix/docs-mdx-escape-angle-brackets
Jun 26, 2026
Merged

fix(docs): escape MDX JSX openers in generated reference tables#40
lukaisailovic merged 1 commit into
mainfrom
fix/docs-mdx-escape-angle-brackets

Conversation

@lukaisailovic

Copy link
Copy Markdown
Owner

Problem

The docs build failed on main:

[plugin fumadocs-mdx:mdx] .../reference/manifest.mdx
273:62-273:488: Expected a closing tag for `<CODE>` before the end of `tableData`

build runs gen:reference first, which regenerates manifest.mdx. A schema field description reads …use 'currency:<CODE>' (e.g. currency:RSD), and the generator emitted that prose verbatim into a table cell. MDX parsed <CODE> as a JSX tag, found no closer, and aborted the build.

Fix

cell() in gen-reference.ts only escaped the pipe, even though its header comment promised cells "stay free of unescaped { } < >". It now also escapes MDX's JSX/expression openers < and {, so any bracket-bearing description renders as literal text. renderType never emits these characters, so type cells are unaffected.

Regenerated manifest.mdx is included — the committed copy was also stale, so the diff additionally reflects current schema (daterange default, query search, currency:<CODE> formats).

Verification

  • pnpm gen:referencecurrency:\<CODE> in output
  • pnpm build in apps/docs completes (prerender + postbuild succeed)

gen:reference emitted description prose like `currency:<CODE>` verbatim into
table cells; MDX parsed `<CODE>` as an unclosed JSX tag and failed the build.
cell() now escapes `<` and `{` alongside the pipe, matching the header
contract. Regenerated manifest.mdx (also picks up stale schema sync).
@lukaisailovic lukaisailovic merged commit 948e92b into main Jun 26, 2026
2 checks passed
@lukaisailovic lukaisailovic deleted the fix/docs-mdx-escape-angle-brackets branch June 26, 2026 17:14
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.

1 participant