Skip to content

Incorrect base64-encoded SVG data placing #4

@lexkrstn

Description

@lexkrstn

I'm using the following Mustache template to produce SASS partial:

$base64-svg-map: ({{#items}}
{{name}}: "{{{data}}}", 
{{/items}});
@mixin base64-svg($name) {
    background-image: #{map-get($base64-svg-map, $name)}, linear-gradient(transparent, transparent);
}

It generates:

$base64-svg-map: (
search-line-options-btn-hi: "url(data:image/svg+xml; ...blah, blah, blah

But my SVG file's data cannot be parsed correctly in this way because it contains parentheses itself.

To solve the issue the data should be enclosed in quatation marks.
Notice that the SASS code above would fail to compile after the change.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions