fix: escape <T> type placeholders in generated EQL docs#33
Merged
Conversation
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.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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
Vercel builds are failing on
main(and any PR branched from it) with:content/stack/reference/eql/index.mdxis regenerated from the upstream EQL release at build time byscripts/generate-eql-docs.ts. The latest release (eql-3.0.0-alpha.1) introduced literal type placeholders likeeql_v3.<T>*in tables.escapeMdxSpecialsescaped stray<unless followed by a letter (/<(?![A-Za-z_$/])/), assuming<Tbegins 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 buildnow completes (regenerates the EQL doc with\<T>escaped, full static generation succeeds). One-line change to the escaping regex; the regeneratedindex.mdxis intentionally not committed since it's a build artifact.