Guide

Streaming

Keep incomplete ```arrow fences non-executable while Comark streams. Pending sandboxes show a placeholder and never boot QuickJS on partial source.

Comark does not close unterminated code fences. While the host is streaming markdown, the last open ```arrow frame must stay non-executable until the fence completes.

Pass a streaming getter to the plugin

Configure the plugin with a getter that reflects whether content is still arriving:

streaming.ts
arrow({ streaming: () => isStreaming.value })

When streaming() returns true and the final fence on the document is still open, the plugin marks that frame status: 'pending'.

Pair with Markdown streaming prop

Wire the same signal into your Comark renderer:

Markdown.vue
<Markdown
  :plugins="[arrow({ streaming: () => isStreaming })]"
  :streaming="isStreaming"
  :components="{ ArrowSandbox }"
/>

Incomplete frames get status: 'pending'. <ArrowSandbox> shows a placeholder and never boots the VM until the fence closes and streaming ends. Completed frames behave normally.

Copyright © 2026