postcss / postcss-url

PostCSS plugin to rebase url(), inline or copy asset.
MIT License
376 stars 59 forks source link

Fix wrong encoding #106

Closed otariidae closed 7 years ago

otariidae commented 7 years ago

Problem

( and ) are not encoded in default SVG encoding mode(encodeURIComponent). This cause error in CSS.

wrong output example:

body {
  background: url(data:image/svg+xml,%3Csvg%3E%3Cg transform%3D%22translate(0)%22%2F%3E%3C%2Fsvg%3E);
}

Solution

Wrap url by quotes.

This PR solves #78.