Skip to content

Fix custom Markdown fixture by preloading JavaScript for nested fences#430

Merged
hippotastic merged 1 commit intomainfrom
hippotastic/fix-custom-md-embedded-lazy
Feb 28, 2026
Merged

Fix custom Markdown fixture by preloading JavaScript for nested fences#430
hippotastic merged 1 commit intomainfrom
hippotastic/fix-custom-md-embedded-lazy

Conversation

@hippotastic
Copy link
Copy Markdown
Collaborator

@hippotastic hippotastic commented Feb 28, 2026

Fixes the flaky custom grammar test fixture. This was caused by a missing embeddedLangsLazy value in the custom grammar, not an actual EC bug.

Astro's parallel page rendering does not guarantee the order of pages during rendering. This caused the flakiness:

  • During most test runs, other pages using the JS language for highlighting were rendered before the custom grammar test page, so the test succeeded.
  • However, sometimes, the custom grammar page was the first one to be rendered, and due to the missing embeddedLangsLazy value, the JS grammar did not get loaded at all and was rendered as plain text, causing the test to fail.

Lesson learned: It's important to properly add all languages included by custom grammars to the embeddedLangsLazy array, or ensure otherwise that they get loaded, e.g. by adding them to the langs array in case of other custom languages.

@netlify
Copy link
Copy Markdown

netlify bot commented Feb 28, 2026

Deploy Preview for expressive-code ready!

Name Link
🔨 Latest commit 48b32ed
🔍 Latest deploy log https://app.netlify.com/projects/expressive-code/deploys/69a2f31ebee41f0008662916
😎 Deploy Preview https://deploy-preview-430--expressive-code.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@hippotastic hippotastic merged commit bba65e6 into main Feb 28, 2026
5 checks passed
@hippotastic hippotastic deleted the hippotastic/fix-custom-md-embedded-lazy branch February 28, 2026 13:55
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