Skip to content

Parser error with SVG datauri inlining #67

Open
@richgilbank

Description

@richgilbank

I hate to open an unclear/ambiguous issue, but I've been unable to track down what's actually going wrong here.
With the following CSS, simply running css.parse() is blowing up:

Error: undefined:1:249: property missing ':'

It seems to only be occurring when there are multiple rules on one line (i.e. minified) that contain the string "charset", only when the SVG is URL encoded. I've stripped it down as much as I can to get it to a readable size (original file: http://www.shopify.com/assets2/application-bf82c00b0b5b610626f416a6ccc3d6aa.css).

Any thoughts on what might be going on here? I'll try to take a closer look in the next few days but figured I'd open the issue in the meantime. Thanks!

.thing1{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg%3E%3Cg%3E%3Crect%20transform=%22matrix(0.7071%20-0.7071%200.7071%200.7071%20-9.5016%2021.7357)%22/%3E%3C/g%3E%3C/svg%3E");}.thing2{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg%3E%3C/svg%3E");}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions