-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Description
Is your feature request related to a problem? Please describe.
I’am maintaining a demo-block plugin that reuses VitePress’s own code highlighting so users don’t need duplicate Shiki configs. In VitePress 1.x we could call md.render inside our markdown-it rule and get final <pre><code> HTML. In 2.x, markdown-it-async replaces the highlight with placeholders during md.render and only resolves them after md.renderAsync, so any plugin capturing HTML during markdown parsing just sees or [object Promise]. To support both versions we currently inject hidden DOM nodes and let Vue read them after hydration, which breaks SSG and feels fragile.
Describe the solution you'd like
Expose a hook that runs after all async highlight promises resolve—e.g., a post-render transform callback or an API to await specific markdown-it-async placeholder IDs—so plugins can access the final highlighted HTML before the page HTML is emitted. That would let demo-blocks pass the resolved <pre> markup directly into their Vue components (or slots) without duplicating Shiki logic and while keeping SSR/SSG intact.
Describe alternatives you've considered
No response
Additional context
No response
Validations
- Follow our Code of Conduct
- Read the docs.
- Read the Contributing Guidelines.
- Check that there isn't already an issue that asks for the same feature to avoid creating a duplicate.