1 Commits

Author SHA1 Message Date
Alois Klink
5fabd414fb fix: error mermaid.parse on invalid shapes
Currently, invalid shapes cause an error when rendering, but not when
parsing. This confuses the Mermaid Live Editor, e.g. by not showing the
error message.

Instead, I've added an `isValidShape()` that validates if the shape is
valid at parse time. This only checks shapes using the new extended
shapes syntax. Currenlty, using `A(-this is an ellipse node-)` is broken
(see #5976) and also causes an invalid shape error at render time, but
I've ignored it in this PR, so it will continue pass at parse-time
(we have unit tests checking ellipse parsing).

See: https://github.com/mermaid-js/mermaid/issues/5976
2024-10-28 23:17:13 +09:00