Skip to content

Minifying SVGs fails w/SVGO #26

@hhsnopek

Description

@hhsnopek

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>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions