# Mermaid export demo This repository includes a runnable playground demo that shows how to intercept the export event from `MermaidBlockNode` and upload the serialized SVG (ev.svgString). - Playground route: `/mermaid-export-demo` - File: `playground/src/pages/mermaid-export-demo.vue` Why use this demo? - Demonstrates how to use `setCustomComponents` to override the mermaid renderer inside `MarkdownRender`. - Shows how to intercept `export` and use `ev.svgString` (or `ev.svgElement`) to upload or send the SVG to an API. Try it: run the playground and visit the route `/mermaid-export-demo`. Try it locally — runnable example You can copy the following single-file component into your app or into the playground to try the export handler immediately. It demonstrates a minimal `setCustomComponents` override that intercepts the `export` event and posts the serialized SVG string to a (fake) API. ```vue ``` Run this in the repo playground with: ```bash pnpm play # open http://localhost:5173/mermaid-export-demo or navigate to the route in the playground ``` Live demo (embedded) You can try the demo right inside the docs site — if the demo is hosted at the public playground URL this iframe will load it (or run the playground locally and open the route):
If the demo shows a blank or black iframe, the remote site may disallow embedding (X-Frame-Options/CSP) or the demo may be offline. Try one of these:
Mermaid export demo screenshot
Preview: Mermaid export demo (run locally if the iframe is blocked)
Open in CodeSandbox If you'd like to edit this demo in a web-based environment, import the repo into CodeSandbox (GitHub import) and open the `playground` folder. Example URL (edit as needed): [Open the playground in CodeSandbox (GitHub import)](https://codesandbox.io/s/github/Simon-He95/markstream-vue/tree/main/playground) CodeSandbox (live editable)
Edit and run the playground in CodeSandbox — open in a new tab if you prefer the full editor experience: Open playground in CodeSandbox