Skip to content

fix(eql-docs): strip Doxygen <tt> tags so a stray one can't break the build#58

Merged
coderdan merged 1 commit into
mainfrom
fix/eql-docs-tt-tag-main
Jul 9, 2026
Merged

fix(eql-docs): strip Doxygen <tt> tags so a stray one can't break the build#58
coderdan merged 1 commit into
mainfrom
fix/eql-docs-tt-tag-main

Conversation

@coderdan

@coderdan coderdan commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Ports #52 (merged to v2) onto main.

Why main needs it too

main currently does not build from a clean checkout. prebuild regenerates content/stack/reference/eql/index.mdx from the upstream EQL manifest, which emits a stray unclosed <tt> tag. MDX requires balanced tags, so the whole build fails:

./content/stack/reference/eql/index.mdx
Error evaluating Node.js code
2153:1-2153:645: Expected a closing tag for `<tt>` (2153:133-2153:137) before the end of `paragraph`

The committed copy of that file is fine, so the failure only appears once prebuild runs. That's why it isn't caught by a plain next build.

<tt> is lowercase-led, so the existing <-escaping rule deliberately leaves it alone (it looks like a real HTML tag). MDX doesn't need it, so the fix drops it.

The change

Cherry-picked 064c1766 from fix/eql-docs-strip-tt-tag, one line plus its comment, in escapeMdxSpecials:

.replace(/<\/?tt\b[^>]*>/gi, "")

Resolved one conflict, purely cosmetic: v2 had wrapped the .replace chain in parentheses. I kept main's formatting and added only the semantic line, so this diff is +6 lines and touches nothing else.

Verification

  • Before: bun run build on main fails at the MDX stage.
  • After: bun run build passes, 589 pages generated, and the regenerated eql/index.mdx contains zero <tt> occurrences.
  • Committed diff is scripts/generate-eql-docs.ts only. The regenerated MDX is left untouched in the tree.

Two sibling branches, fix/eql-mdx-escape-lt and fix/eql-docs-mdx-escape, target adjacent problems in the same function and are still unmerged on both branches. Worth deciding whether they're superseded.

… build

The EQL reference generator fetches the latest release's API.md at build time
and passes lowercase-led tags (e.g. `<tt>`) through as real HTML. MDX requires
every tag to be balanced, so a mangled SQL-comment source that emits an
unclosed `<tt>` fails the whole Vercel build — which is exactly what
eql-3.0.0-alpha.3 did (index.mdx:2153, `Expected a closing tag for <tt>`).

`<tt>` is Doxygen's teletype tag; MDX doesn't need it. Strip `<tt>`/`</tt>`
(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.
@vercel

vercel Bot commented Jul 9, 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 Jul 9, 2026 5:54am

Request Review

@coderdan
coderdan merged commit b8dfefd into main Jul 9, 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