From 332240ac38c07b42f6bec8d4bee3870ae83f880a Mon Sep 17 00:00:00 2001 From: Dan Draper Date: Wed, 8 Jul 2026 16:48:13 +1000 Subject: [PATCH] fix(eql-docs): strip Doxygen tags so a stray one can't break the build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The EQL reference generator fetches the latest release's API.md at build time and passes lowercase-led tags (e.g. ``) through as real HTML. MDX requires every tag to be balanced, so a mangled SQL-comment source that emits an unclosed `` fails the whole Vercel build — which is exactly what eql-3.0.0-alpha.3 did (index.mdx:2153, `Expected a closing tag for `). `` is Doxygen's teletype tag; MDX doesn't need it. Strip ``/`` (non-code text only) before escaping, so malformed upstream docs degrade gracefully instead of taking the deploy down. Verified: regenerated content/stack/reference/eql/index.mdx from the live eql-3.0.0-alpha.3 release and `next build` compiles all 329 pages. --- scripts/generate-eql-docs.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/generate-eql-docs.ts b/scripts/generate-eql-docs.ts index 4c85527..2ad8994 100644 --- a/scripts/generate-eql-docs.ts +++ b/scripts/generate-eql-docs.ts @@ -119,6 +119,12 @@ function escapeMdxSpecials(content: string): string { return part .replace(/\{/g, "\\{") .replace(/\}/g, "\\}") + // Strip Doxygen's `` teletype tags. They're a lowercase-led + // "tag" so the `<` rule below leaves them intact, but MDX requires + // every tag to be balanced — and mangled SQL-comment source can + // emit a stray, unclosed `` (e.g. eql-3.0.0-alpha.3's API.md), + // which fails the whole build. MDX doesn't need the tag, so drop it. + .replace(/<\/?tt\b[^>]*>/gi, "") // Escape `<` unless it begins a real JSX/HTML tag, a closing // tag, or an autolink (followed by a lowercase letter, `_`, `$`, // or `/`). Uppercase-led tokens like `` are type placeholders