FWeinb / grunt-svgstore

Merge svgs from a folder
MIT License
920 stars 94 forks source link

Fixed only checking 'viewBox', and not 'viewbox' on source items #125

Closed roelofr closed 5 years ago

roelofr commented 8 years ago

It took me about an hour to figure out why my icons weren't sizing properly. This small fix should take care of that.

Basically, the old code only checked for a viewBox element. Making the following result in a viewBox-less symbol:

<?xml version="1.0" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewbox="0 0 22 16">
  <polyline fill="none" stroke-width="2" points="1 7 8 14 21 1"/>
</svg>

I'd love to make some unit tests for this, but sadly can't get my head around the unit test system at the moment (maybe because it's Friday afternoon).