reshape / minify

a reshape plugin to minify html output
Other
5 stars 3 forks source link

Minifying SVGs fails w/SVGO #26

Open hhsnopek opened 6 years ago

hhsnopek commented 6 years ago

Problem

During the minify process of SVGs, no SVG is produced in the mark up.

Example SVG as a sugarml file: x.sgr

svg(xmlns='http://www.w3.org/2000/svg', viewbox='0 0 24 24')
  path.st0(d='M24 2.4L14.4 12l9.6 9.6-2.4 2.4-9.6-9.6L2.4 24 0 21.6 9.6 12 0 2.4 2.4 0 12 9.6 21.6 0z')

Generated Output (gathered by adding a console.log after lib/modules/minifySvg.js#L8)

NOTE: This generated svg was confirmed invalid using https://validator.w3.org/check

<svg xmlns="http://www.w3.org/2000/svg" , viewbox="0 0 24 24"><path class="st0" d="M24 2.4L14.4 12l9.6 9.6-2.4 2.4-9.6-9.6L2.4 24 0 21.6 9.6 12 0 2.4 2.4 012 9.6 21.6 0z"></path</svg>