iconic / SVGInjector

Fast, caching, dynamic inline SVG DOM injection library
MIT License
975 stars 145 forks source link

SVG Injector doesn't work if there is a URL parameter #17

Closed majksner closed 9 years ago

majksner commented 10 years ago
<img data-src="/build/img/logo.svg?v=0.1.81" data-fallback="/build/img/logo.png?v=0.1.81" class="svg" alt="Logo">
protodave commented 9 years ago

Fixed this by updating the regex that was matching the SVG file extension to allow for query strings. Adding a version # query string to assets is a common cache-busting technique used by CDNs (including Shopify).

renestalder commented 9 years ago

@protodave is this already included in the current iconic.js? It seems not to work.

protodave commented 9 years ago

Not yet, but It'll be in the next Iconic release, v1.7.0, which is almost ready. If you want the updated iconic.js sooner just shoot me an email to yourfriends -at- useiconic.com and I'll sent it to you!

renestalder commented 9 years ago

@protodave Thanks Dave. I temporary added the fix myself to the minified iconic.js (since it's really to update the regex).

I'm okay with waiting for the official release.

protodave commented 9 years ago

Ok, great, thanks. The new Iconic release should be out in the next couple of days.