pub(crate) fn apply_scale_to_svg(svg: &str, scale: f32) -> StringExpand description
Apply a direct scale to the provided SVG markup by inserting a <g transform="scale(...)">
around the SVG contents and multiplying simple numeric width/height attributes when present.
It also adjusts a viewBox attribute’s width/height so that SVGs that rely on viewBox
sizing are not cropped after applying the transform.
This is intentionally lightweight (string-based) to avoid pulling in an XML parser as a dependency. It handles common cases emitted by Mermaid and similar tools, but leaves complex or non-numeric attributes unchanged.