codefeathers / rollup-plugin-svelte-svg

Import SVG files as Svelte Components
MIT License
75 stars 13 forks source link

Duplicate SVG tags #5

Closed t4t5 closed 4 years ago

t4t5 commented 4 years ago

It seems like this plugin always generates a parent <svg> wrapping the original.

Example:

Screenshot 2020-03-08 at 06 10 52

While it seems like it still renders in the browser, it makes it much more difficult to adjust things like the width and height, since you're just editing the container SVG instead of the "real" one.

MKRhere commented 4 years ago

I'm aware of this issue. I just need to strip the actual svg tag from the source. I wasn't comfortable with bundling a full XML parser and RegExp isn't a good way to parse XML.

I will fix it soon, since it seems this package is being used quite a bit outside our company. Thanks for bringing this up!

joycollector commented 4 years ago

Should be fixed by #6

MKRhere commented 4 years ago

Closed in #6

Released as 0.2.2 on npm