ember-cli / broccoli-asset-rev

Broccoli plugin to add fingerprint checksums and CDN URLs to your assets
MIT License
87 stars 84 forks source link

Prepend brakes SVG icon references #51

Open voltidev opened 9 years ago

voltidev commented 9 years ago

I use inline SVG icons like this in my components/side-bar.hbs:

<svg><use xlink:href="/icons.svg#my-icon-name"></use></svg>

Here is what I get after prepend:

<svg><use xlink:href="https://cloud.com/icons-2d8bb19bb3d1a09b68444738ca864c06.svgmy-icon-name"></use></svg>

Here is what I expect to have:

<svg><use xlink:href="https://cloud.com/icons-2d8bb19bb3d1a09b68444738ca864c06.svg#my-icon-name"></use></svg>

Basically, prepend removes the # from the icon reference icons-2d8bb19bb3d1a09b68444738ca864c06.svg#my-icon-name, after that the reference will look like this: icons-2d8bb19bb3d1a09b68444738ca864c06.svgmy-icon-name.

I have this problem only when I use prepend. Why prepend removes the # from the original URL?Please advise how we can solve this problem. It actually can be related to this one https://github.com/rickharrison/broccoli-asset-rev/issues/42

Just in case, here is how the icons.svg looks inside:

<svg xmlns="http://www.w3.org/2000/svg">
  <symbol id="my-icon-name" viewBox="0 0 512 512">
    <path d="m448 53c0-1 ... 0z"/>
  </symbol>
</svg>
rickharrison commented 9 years ago

I will try and look into this soon. If you could dig in as well and help find the cause, I'd really appreciate it.

max commented 9 years ago

@ivanvotti Thanks for filing this. I just ran into this myself.

jclem commented 9 years ago

@max @ivanvotti @rickharrison It's a bug in broccoli-asset-rewrite. PR here to fix it.

seanrucker commented 8 years ago

Was this ever fixed? I'm running into this exact issue.