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

Svg plugin is returning the id of the graphic inserted while it should the id of the icon requested. #29

Closed
clmath opened this issue Oct 23, 2015 · 1 comment
Labels
Milestone

Comments

@clmath
Copy link
Member

clmath commented Oct 23, 2015

From #26:

One issue I notice is that svg!icon.svg will normally evaluate to icon.svg (i.e require(["svg!icon1.svg"], function(id){ console.log(id); }) will print icon.svg), except when icon1.svg is inside a sprite. At that point it evaluates to sprite.svg or something like that. Shouldn't it still evaluate to icon.svg?

I think the plugin should return the id of the svg graphic requested. This may be the file name of the svg or the content of the id attribute on the symbol element. The tricky part is to keep the binding between requested file name and icon id when we load the sprite.

@wkeese
Copy link
Member

wkeese commented Oct 23, 2015

As I explained in #30, this should be fixed before people start using the plugin, because code that uses the plugin should get the id from the plugin return value, rather than assuming the id matches the filename.

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

No branches or pull requests

2 participants