Skip to content
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

Diagram not rendering if it's in an unopened tab from sphinx-design's tab-set #126

Open
jkeneda opened this issue Jul 2, 2023 · 1 comment

Comments

@jkeneda
Copy link

jkeneda commented Jul 2, 2023

I'm trying to write up some math notes for my students, and I'm encountering an issue where a Mermaid diagram isn't rendering correctly if it's in a secondary tab (i.e. if the tab containing it is not visible when the page loads).

I've got a minimal working example here, along with the initial sphinx (er, Jupyterbook) code for it.

I tried comparing the html for the correct render against the flawed one, and I see that the flawed render has several heights/widths set to zero. Maybe that could help with the diagnosis, but I don't know enough about either sphinx or this project to make further progress.

Thanks for reading (and for this project!), and let me know if you've got any ideas for solutions I could try!

@agagniere
Copy link

Hi,
I have the same issue...

There is a dirty workaround: when switching tab, refresh the page, it renders the diagram fine.

This behavior hints towards a lazy javascript rendering.
So I guess that forcing mermaid diagrams to be rendered to svg / png would be a workaround as well (setting mermaid_output_format in conf.py)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants