jekyll-minifier icon indicating copy to clipboard operation
jekyll-minifier copied to clipboard

Inline Data URI, SVG XML loses whitespace

Open danielhaim1 opened this issue 6 years ago • 1 comments

I identified an issue with the minifier which removes whitespace from Data URI.

Input (expected results):

background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'%3E%3Cpath fill='%23343a40' d='M2 0L0 2h4zm0 5L0 3h4z'/%3E%3C/svg%3E");

The minifier strips the whitespace, thus breaking it, output:

background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0045'%3E%3Cpathfill='%23343a40'd='M20L02h4zm05L03h4z'/%3E%3C/svg%3E");

danielhaim1 avatar Jun 03 '18 19:06 danielhaim1

There are 3 issues open for YUI regarding this. However, this plugin replaced YUI with Uglifier and cssminify2. I can't find an issue in either project about this, which is probably where it belongs.

Having said that, I too am experiencing this problem.

EDIT: Fixed here: https://github.com/bbbenji/cssminify/commit/3fe1f665720edd4a94da80337cb1f263acbcc548

bbbenji avatar Nov 29 '18 11:11 bbbenji