New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add loading spinners and mermaid error handling #12358
Conversation
Could you rename |
I'm kind of wary of using too common classnames because they could clash with other frameworks like swagger-ui that uses |
Classes switched. |
Bit off topic... But related, what will happen if mermaid can not render image because of syntax error? |
I think it may throw an JS error, not sure how well that library behaves or if it has a fallback rendering. Looking at GitLab code, they seem to have a Edit: Yeah it does throw an error. Will check that later. Probably good to fix this in this PR because otherwise the box would stay loading forever. |
9736b24
to
ac57d87
Compare
fe2fe18
to
f33f740
Compare
It seems the way we initialize mermaid using |
Should be fixed. That API of mermaid is absolutely horrendous, especially its error handling but this seems to produce much better renderings now for me. |
- Add loading spinners on editor and mermaid renderers - Add error handling and inline error box for mermaid - Fix Mermaid rendering by using the .init api
Squashed, update OP and removed a few outdated comments in this PR. |
I still think we'll end up with mermaid being used outside of markdown and will have to move stuff around but that's fine |
Yeah I guess we can move both less and js files around then but the current structure is good enough for markdown-only content like mermaid currently. |
.init
API