0.6.0 - 2026-05-28
Release Notes
This release adds an opt-in SVG output pipeline for applications that need Mermaid-parity SVG by default but also need cleaner output for in-app previews, PNG/PDF export, or host-specific theming. Use render_svg_sync for parity snapshots, SvgPipeline::readable() when the SVG will be inlined and should keep readable fallback text, and SvgPipeline::resvg_safe() before rasterizing through resvg / usvg.
Added
-
Added
SvgPipeline::readable()andSvgPipeline::resvg_safe()for callers that need fallback text, rasterizer-friendly SVG, or cleanup without changing defaultrender_svg_syncoutput. -
Added host styling extension points:
SvgPostprocessorfor custom passes,ScopedCssPostprocessorfor CSS injection, andCssOverridePolicy::StripExistingImportantfor callers that want app styles to override Mermaid defaults. Postprocessors can read the diagram type, title, and root SVG id fromSvgPostprocessContext. -
Expanded Zed-derived regression coverage for Sequence, Flowchart, ER, Gantt, Class, and raster fallback cases.
-
Added crate-specific README pages for
merman-core,merman-render, andmerman-cli, including focused parsing, rendering, and CLI examples for docs.rs/crates.io users. -
Added a rendering guide in
docs/rendering/SVG_OUTPUT_PIPELINE.mdand a runnablesvg_pipelineexample:cargo run -p merman --features render --example svg_pipeline < fixtures/flowchart/basic.mmd > out.svg
Library integrations can use the same pipeline directly. This example builds a typical editor/export pipeline: make the SVG
resvg-friendly, allow host CSS to override Mermaid defaults, and scope the injected CSS to one diagram id.use merman::render::{ CssOverridePolicy, HeadlessRenderer, ScopedCssPostprocessor, SvgPipeline, }; let pipeline = SvgPipeline::resvg_safe().with_postprocessor( ScopedCssPostprocessor::new( r#" .node rect { stroke: #2563eb; stroke-width: 2px; } .merman-foreignobject-fallback-text { fill: #111827; } "#, ) .with_override_policy(CssOverridePolicy::StripExistingImportant), ); let renderer = HeadlessRenderer::new().with_diagram_id("host-diagram"); let svg = renderer .render_svg_with_pipeline_sync("flowchart TD; A[API]-->B[DB];", &pipeline)? .unwrap(); # let _ = svg; # Ok::<(), Box<dyn std::error::Error>>(())
Changed
- Readable SVG helpers, raster helpers, and CLI raster export now use the shared SVG output pipeline; default
render_svg_syncremains Mermaid-parity output with no consumer cleanup. ScopedCssPostprocessornow inserts host CSS after existing SVG styles when possible, so scoped host rules follow Mermaid defaults in cascade order.
Fixed
- Fixed Architecture arrowheads on diagonal edges so they follow the rendered line direction.
- Fixed readable/raster output for Mermaid HTML labels: fallback text now handles literal
\n, avoids double-escaped entities such as class generics, and keeps useful styling context for host CSS. - Fixed sequence diagrams with keyword-like participant ids such as
AS,END,RECT, orloop. - Hardened
SvgPipeline::resvg_safe()against commonusvg/resvgincompatibilities, including unsupported CSS, animation declarations, invalid visual attributes, empty rectangle placeholders, CSSdegunits, and non-finite values.
Install merman-cli 0.6.0
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/Latias94/merman/releases/download/v0.6.0/merman-cli-installer.sh | shInstall prebuilt binaries via powershell script
powershell -ExecutionPolicy Bypass -c "irm https://github.com/Latias94/merman/releases/download/v0.6.0/merman-cli-installer.ps1 | iex"Download merman-cli 0.6.0
| File | Platform | Checksum |
|---|---|---|
| merman-cli-aarch64-apple-darwin.tar.xz | Apple Silicon macOS | checksum |
| merman-cli-x86_64-apple-darwin.tar.xz | Intel macOS | checksum |
| merman-cli-x86_64-pc-windows-msvc.zip | x64 Windows | checksum |
| merman-cli-x86_64-unknown-linux-gnu.tar.xz | x64 Linux | checksum |