-
-
Notifications
You must be signed in to change notification settings - Fork 39
Description
Current behavior
When running the docs in dev mode (npm run dev), code blocks inside markdown files included via ExampleBlock (e.g. the custom languages example on https://vitepress-openapi.vercel.app/customizations/code-samples.html#custom-languages) render without or mostly broken syntax highlighting.
This seems to work correctly in production builds (npm run build && npm run preview).
Desired behavior
Syntax highlighting should work the same way in both dev and production modes.
Having it broken during dev mode is not a huge issue, but it can be misleading. Modifications to the useShiki composable should only affect the OpenAPI rendering part, but the missing highlighting definitely made me double-check I hadn't accidentally broken something while working on it.
Reproduction
No response
Steps to reproduce
- Clone the repo, run
npm install - Delete
.vitepress/cachedirectory - Run
npm run dev - Navigate to http://localhost:5173/customizations/code-samples.html
- Scroll to the "Custom Languages" example block
- Observe: no syntax highlighting on the code block
- Stop dev server, run
npm run build && npm run preview - Navigate to the same page, syntax highlighting works correctly
Logs and Error Messages
No response
Other Information
Tested on v0.1.13 with a clean state, fresh dependencies and VitePress cache. The issue appears to be specific to dev mode, production builds highlight correctly.

