Repository navigation
mermaid-text-0.57.0
·
70 commits
to master
since this release
Added
RenderOptions::max_width_strict(defaultfalse). Whentrueand
max_widthisSome(n), a render whose widest line still exceedsn
display columns returns the newError::TooWide { requested, actual }
instead of an over-wide string. This turnsmax_widthfrom a soft hint into
a hard budget, so an embedder with a fixed panel width gets a "fits or tells
you it can't" contract and can fall back knowingly (e.g. to fenced source)
without post-measuring every line. Width is measured in display columns and
ignores ANSI escapes emitted bycolor. Requested by @vshylov (#32).mermaid-text --strictCLI flag: with--width N, exit non-zero when
the widest line still exceedsN.
Changed (breaking, per 0.x semver)
RenderOptionsgains a field andErrorgains a variant. Callers that
constructRenderOptionswith a full struct literal (rather than
..Default::default()) or matchErrorexhaustively need a trivial update.
Existingrender/render_with_width/render_with_optionsbehaviour is
unchanged whenmax_width_strictis left at itsfalsedefault.