webpack-contrib/svg-inline-loader

SVG rect broken

rondonjon opened this issue · 2 comments

The following RegExp breaks <rect> tags because it removes their width and height attributes!

                 .replace(/width="\d+(\.\d+)?(px)?"/gi, "")
                 .replace(/height="\d+(\.\d+)?(px)?"/gi, "")

Do you think you could restrict the RegExp's to SVG tags only?

Thanks for the report. I've never thought about it (usually I use this to remove useless crust from SVGs generated by Sketch and Photoshop, which is usually <svg /> containing a single <g /> node) but it should be done. ;) I will look into that.