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.61k stars 6.62k forks source link

can't catch parse error Maximum call stack size exceeded on safari #421

Closed kaqiling closed 6 years ago

kaqiling commented 7 years ago

Hi, I'm using mermaid, but I find a problem in https://github.com/knsv/mermaid/blob/master/src/mermaidAPI.js#L291. When flowchart contains a Chinese symbol like ';' or '《' , Chrome will catch Maximum call stack size exceeded, but Safari will call recursively and comsume memory endlessly, and I can't do anything on Safari.

kaqiling commented 7 years ago

Please paste code like

graph LR
A--》B

in http://knsv.github.io/mermaid/live_editor/ in safari browser. I use mermaid in Mac OS x WebView, the bug is also produced in my application. And chrome is ok. If someone input Chinese symbol like '《' by a mistake, we should tell him or her invalid syntax instead of doing noting and let the application unresponsive.

kaqiling commented 7 years ago

also for #405

tylerlong commented 6 years ago

Issue diappeared: https://mermaidjs.github.io/mermaid-live-editor/#/edit/Z3JhcGggTFIKQS0t44CLQg/error/TGV4aWNhbCBlcnJvciBvbiBsaW5lIDIuIFVucmVjb2duaXplZCB0ZXh0LgpncmFwaCBMUkEtLeOAi0IKLS0tLS0tLS0tLS1e