Skip to content

Docs: escape MDX braces in changelog body#3533

Merged
adamziel merged 1 commit intotrunkfrom
adamziel/mdx-ci-fix
Apr 27, 2026
Merged

Docs: escape MDX braces in changelog body#3533
adamziel merged 1 commit intotrunkfrom
adamziel/mdx-ci-fix

Conversation

@adamziel
Copy link
Copy Markdown
Collaborator

@adamziel adamziel commented Apr 27, 2026

What happened

#3531 tried to fix the broken docs build by telling Docusaurus to parse changelog.md as plain CommonMark instead of MDX — adding a format: md frontmatter to the file. The hope was that Docusaurus would then leave { / } / <…> in PR titles alone.

It didn't work. The CI run on trunk for that exact commit still crashed during SSG with:

ReferenceError: web is not defined
  at _createMdxContent (server.bundle.js:17281:47)

…on @php-wasm/{web,node}-5-2. Docusaurus 3.9.2 ran the file through the MDX pipeline anyway, so test-docs-api-reference and Deploy doc site are still red on trunk.

I don't fully understand why format: md was ignored here — it might need a global markdown.format setting, a different file extension, or it may simply not behave the way the docs imply in this version. Worth a follow-up, but trunk needs to be green now.

This PR (workaround)

Stop relying on Docusaurus mode and make the content itself inert:

  • refresh-changelog.ts now backslash-escapes { and } in the copied changelog body, so future PR titles with braces stay safe regardless of how Docusaurus parses the file.
  • The currently-broken v3.1.21 entry is escaped directly to unbreak trunk immediately.

Test plan

  • test-docs-api-reference passes
  • Deploy doc site passes

The previous fix relied on a `format: md` frontmatter hint, but Docusaurus
3.9 still ran the changelog through the MDX pipeline and crashed on
`@php-wasm/{web,node}-5-2`, taking out test-docs-api-reference and the
docs deploy on trunk.

Escape `{` and `}` in the body when the refresh script copies the
changelog over, and unbreak the v3.1.21 entry now so trunk goes green.
@adamziel adamziel requested review from a team, ashfame and Copilot April 27, 2026 14:56
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Updates the docs changelog content to be MDX-safe by escaping curly braces so the page renders without triggering MDX expression parsing failures.

Changes:

  • Escapes { and } in the affected changelog entry (@php-wasm/{web,node}-5-2) to prevent MDX runtime errors.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@adamziel adamziel merged commit 778d986 into trunk Apr 27, 2026
47 checks passed
@adamziel adamziel deleted the adamziel/mdx-ci-fix branch April 27, 2026 15:22
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.

2 participants