Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DataURI without optional <mediatype> part incorrectly put inside single quote #1122

Closed
awarecan opened this issue Jun 17, 2020 · 0 comments · Fixed by #1127
Closed

DataURI without optional <mediatype> part incorrectly put inside single quote #1122

awarecan opened this issue Jun 17, 2020 · 0 comments · Fixed by #1127

Comments

@awarecan
Copy link
Contributor

  • clean-css version - npm ls clean-css: 4.2.3
  • node.js version - node -v: 12.16.2
  • operating system: Mac

Configuration options

var CleanCSS = require('clean-css');
var input = "@font-face{font-family:'B';src:url(\"data:;base64,SEVMTE8=\")}";
var output = new CleanCSS({}).minify(input);

Input CSS

@font-face {
    font-family: 'B';
    src: url("data:;base64,SEVMTE8=");
}

Actual output CSS

@font-face{font-family:'B';src:url("'data:;base64,SEVMTE8='")}

Expected output CSS

@font-face{font-family:'B';src:url(data:;base64,SEVMTE8=)}

Per RFC 2397, <mediatype> is optional in data uri. data:;base64 is valid, should not be put inside single quote.

It is a special case of #676

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant