Open
Description
Description
if code end with space,run mermaid.parse(code)
return true. But when run mermaid.parse({nodes: [ref.current])
throw error.
Steps to reproduce
const code = `
sequenceDiagram
participant Alice
participant Bob
Alice->>Bob: 你好,Bob!
Bob-->>Alice:
` + ' '
const html = <div ref={ref}>{code}</div>
when run mermaid.parse(code)
return true. But when run mermaid.parse({nodes: [ref.current])
throw error.
when I read the source code of mermaid.run
, I found that it will trim the space of code. It is the reason of the bug.
Screenshots
No response
Code Sample
No response
Setup
- Mermaid version:
- Browser and Version: [Chrome, Edge, Firefox]
Suggested Solutions
No response
Additional Context
No response
Activity