-
-
Notifications
You must be signed in to change notification settings - Fork 7.1k
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
Generated SVG has static IDs which cause issues when there are two SVGs #3267
Comments
I am working on #1871 and the root cause was non-unique ids for the SVG markers. And the fix for it was exactly what you suggested. |
@dwhelan Maybe it's also related to this? livebook-dev/livebook#1440 |
Yes @williamthome, I believe this is root cause of what you saw with livebook-dev/livebook#1440. I do not have an ETA on getting that merged but will respond here when it is done. Is it urgent for you? |
Ah, sure. It's ok for me. I have no urgency. |
This is pretty urgent for me - would love to see your fix get merged in as soon as feasible @dwhelan 🙏🏻 |
Fixed in #4825 |
Describe the bug
In the attached (zipped) html, there are two SVGs generated by mermaid. Loaded in a browser they will render with arrowheads. However, if the first SVG style has 'display:none' then not only does it disappear (as expected), but also the arrow heads in the second SVG. The reason is that they are referenced as
#arrowhead
and so the browser finds them in the first SVG, which is not displayed, hence they are not displayed.svgs.zip
Expected behavior
Create unique IDs. E.g. use the id passed to render as prefix.
(Note: there is another generic solution which is to wrap each SVG in an iframe via srcdoc. However, then styling in the outer doc can't be applied to the svg elements which for my context of static HTML files is not good)
Screenshots

When both are visible:
When first one is not displayed:

The text was updated successfully, but these errors were encountered: