mermaid-js / mermaid

Generation of diagrams like flowcharts or sequence diagrams from text in a similar manner as markdown
https://mermaid.js.org
MIT License
72.08k stars 6.54k forks source link

gitGraph diagrams do not render in "sandbox" security mode #4985

Open jasonphillips opened 1 year ago

jasonphillips commented 1 year ago

Description

gitGraph diagrams throw an error when rendering in "sandbox" mode.

Failing example with sandbox mode ON: https://codesandbox.io/s/strange-yonath-3zfm8q?file=/src/index.js

Working example, only difference is no sandbox: https://codesandbox.io/s/quirky-field-vpz6w2?file=/src/index.js

Steps to reproduce

Initialize mermaid with any configuration that includes:

{
  securityLevel: "sandbox"
}

Then try to render a gitGraph diagram.

Screenshots

No response

Code Sample

See the 2 links above

Setup

Suggested Solutions

No response

Additional Context

No response

iansan5653 commented 5 months ago

Also seeing this. "Cannot read properties of null (reading 'appendChild')" when Mermaid tries to call label.node().appendChild(labelElement);