Skip to content

SVG height attribute absent with 9.1.7 #3659

@silverwind

Description

@silverwind

Describe the bug
Since 9.1.7, it seems that the SVG that mermaid.mermaidAPI.render no longer produces a height attribute on the <svg> root node. Having a known height is important for page layout for example when rendering into a <iframe> which generally requires a height.

Opening SVG Tag in 9.1.6:

<svg viewBox="0 0 124.61666870117188 236" style="max-width: 124.61666870117188px;" height="236" aria-labelledby="chart-title-mermaid chart-desc-mermaid" role="img" xmlns="http://www.w3.org/2000/svg" width="100%" id="mermaid">

Opening SVG Tag in 9.1.7:

<svg viewBox="0 0 124.61666870117188 236" style="max-width: 124.61666870117188px;" aria-labelledby="chart-title-mermaid chart-desc-mermaid" role="img" xmlns="http://www.w3.org/2000/svg" width="100%" id="mermaid">

To Reproduce
Render this source using mermaid.mermaidAPI.render("mermaid", source, callback):

  graph TD;
      A-->B;
      A-->C;
      B-->D;
      C-->D;

Expected behavior
The height attribute to be present.

I think it may have regressed in https://github.com/mermaid-js/mermaid/pull/3364/files#diff-3274f1a37032fb0ae4e2823def0007c634e869ae0dfc304ff6a12c36513c3a52.

Metadata

Metadata

Assignees

Labels

Type: Bug / ErrorSomething isn't working or is incorrect

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions