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

SVGInjector messes up id's inside defs #15

Open
yiotaz opened this issue Mar 1, 2017 · 6 comments
Open

SVGInjector messes up id's inside defs #15

yiotaz opened this issue Mar 1, 2017 · 6 comments

Comments

@yiotaz
Copy link

yiotaz commented Mar 1, 2017

This is a reference issue, since the old version seems a bit abandoned.
iconic#29

Can you help me sort this out?
I can send you my svg file if it will help somehow.

@flobacher
Copy link
Owner

Hi,
do you still have this issue, and if, does it happen with svginjector2 or with the original version?
Since the original issue seems to be resolved, I would like to close this too.. thx!

@gebeer
Copy link

gebeer commented Mar 15, 2018

I hate to say that we are having exactly the same issue here with v2.1.3

@gebeer
Copy link

gebeer commented Mar 15, 2018

As a temp workaround for our use case I uncommented https://github.com/flobacher/SVGInjector2/blob/master/src/svg-injector.js#L390
This helped

@flobacher
Copy link
Owner

@gebeer could you please provide a sample so I can reproduce this? thank you!

@gebeer
Copy link

gebeer commented Mar 17, 2018

@flobacher I setup a test to reconfirm the issue.
But in the isolated test context it won't happen.
The problem only appears to happen in IE11/Edge where clip-path ids are incorrect.
In the svg folder of the test repo are the original svg and the injected versions. One injected with Firefox, one with Edge.
If you compare those, you will see that for the Edge version, the clipPath IDs inside get appended a '-0' while the clip-path attributes further down are lacking that '-0'
Example Edge:
L. 17 inside : <clipPath id="clip-path-2-0">
L.365 : <g clip-path="url(&quot;#clip-path-2&quot;)">

In the Firefox version the '-0' gets appended correctly also in L365

Here's how the problematic SVG looks in original context in Edge:
image

Hope this is of any help. Unfortunately I can't supply a live non-working example.

@flobacher flobacher reopened this Mar 20, 2018
@flobacher
Copy link
Owner

@gebeer thank you for that example! I will try to take a look. I must apologize if it takes a bit of time, but I only do this in my spare time and my timely-ressources are limited. I would be more than happy to accept a PR ofc =)
Also I experienced something similar once with Edge 14, but with 16 the issue went away..

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

3 participants