jkgng / minify

Automatically exported from code.google.com/p/minify
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

CSS Background Image URL Rewritten Incorrectly #296

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
No problems with minifying JavaScript and no issues with Stylesheets when 
forcing merge instead of full minimization (by specifying Minify_Source with 
minifier = '')

Minify commit/version: 2.1.7
PHP version: 5.4.12

What steps will reproduce the problem?
1. Stylesheet with rule for background-image whose URL is a relative path:

.pseudoSelect a {
background: url("../img/editor/checked.png") no-repeat scroll 10px center 
#2A2A2A;
}

2. Minified (not just merged)

Expected output:
.pseudoSelect
a{background:url("../img/editor/checked.png") no-repeat scroll 10px center 
#2A2A2A;}

Actual output:
.pseudoSelect
a{background:url("/css/img/editor/checked.png") no-repeat scroll 10px center 
#2A2A2A;}

Note that "../img" has now become "/css/img"

Original issue reported on code.google.com by buzcarter on 14 Sep 2013 at 8:05

GoogleCodeExporter commented 9 years ago
This is a feature. http://code.google.com/p/minify/wiki/UriRewriting

Post to the Google group for support on configuring the rewriting.

Original comment by mrclay....@gmail.com on 14 Sep 2013 at 11:45

GoogleCodeExporter commented 9 years ago
Doh! I'm duly shamed. Thanks much, works perfectly as advertised! (note to 
self: RTFM)

Original comment by buzcarter on 15 Sep 2013 at 8:33