Skip to content

fix: escape <T> type placeholders in generated EQL docs#33

Merged
coderdan merged 1 commit into
mainfrom
fix/eql-docs-mdx-escape
Jun 23, 2026
Merged

fix: escape <T> type placeholders in generated EQL docs#33
coderdan merged 1 commit into
mainfrom
fix/eql-docs-mdx-escape

Conversation

@coderdan

Copy link
Copy Markdown
Contributor

Problem

Vercel builds are failing on main (and any PR branched from it) with:

./content/stack/reference/eql/index.mdx
Expected a closing tag for `<T>` before the end of `tableData`

content/stack/reference/eql/index.mdx is regenerated from the upstream EQL release at build time by scripts/generate-eql-docs.ts. The latest release (eql-3.0.0-alpha.1) introduced literal type placeholders like eql_v3.<T>* in tables.

escapeMdxSpecials escaped stray < unless followed by a letter (/<(?![A-Za-z_$/])/), assuming <T begins a real JSX tag. So <T> slipped through unescaped and MDX/Turbopack tried to parse it as a component, breaking the build.

Fix

Restrict the no-escape lookahead to lowercase-led tags, closing tags (/), and autolinks (/<(?![a-z_$/])/). Uppercase-led tokens like <T> are type placeholders in this auto-generated reference (never JSX), so they're now escaped. Lowercase HTML tags and <https://…> autolinks are unaffected.

Verification

bun run build now completes (regenerates the EQL doc with \<T> escaped, full static generation succeeds). One-line change to the escaping regex; the regenerated index.mdx is intentionally not committed since it's a build artifact.

The EQL reference is regenerated from the upstream release at build time.
eql-3.0.0-alpha.1 introduced literal type placeholders like `eql_v3.<T>*`
in tables. escapeMdxSpecials skipped any `<` followed by a letter, so `<T>`
was treated as an unclosed JSX tag and broke the MDX/Turbopack build.

Restrict the no-escape lookahead to lowercase-led tags, closing tags, and
autolinks; uppercase-led tokens are type placeholders and are now escaped.
@vercel

vercel Bot commented Jun 23, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
public-docs Ready Ready Preview, Comment Jun 23, 2026 8:37am

Request Review

@coderdan coderdan merged commit a402c3e into main Jun 23, 2026
2 checks passed
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