jalmenarez / minify

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

multiple word font names mangled in CSS #76

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Minify version:
PHP version: 5

What steps will reproduce the problem?
1. Combine any style sheet which lists fonts with spaces

Expected output:
font-family:bookantiqua,palatinolinotype,palatino,garamond,serif,timesnewroman;

Actual output: font-family:book antiqua,palatino
linotype,palatino,garamond,serif,times new roman;

Did any unit tests FAIL?

Please provide any additional information below.

Perhaps a regular expression for the font-family tag?

Original issue reported on code.google.com by mrr...@gmail.com on 13 Jan 2009 at 11:43

GoogleCodeExporter commented 9 years ago
The expected output and actual output are reversed in my issue report above--my
apologies. The idea is that font names with spaces are having the spaces 
trimmed,
rendering, for example "Times New Roman" as "TimesNewRoman" and thus failing to 
style
the document properly.

Original comment by mrr...@gmail.com on 14 Jan 2009 at 2:45

GoogleCodeExporter commented 9 years ago
You *are* quoting font names w/ spaces, right? Otherwise it's invalid.
Could you attach the smallest CSS file that demonstrates this issue?

We already have 3 test files where the spaces aren't removed:
* 
http://code.google.com/p/minify/source/browse/trunk/min_unit_tests/_test_files/c
ss/
styles.min.css
* font:12px Courier,"Courier New",sans-serif; in:
  http://code.google.com/p/minify/source/browse/trunk/min_unit_tests/_test_files/css/
subsilver.min.css
* font-family:'Lucida Sans Unicode','Lucida Grande',Sans-Serif,Verdana,Arial; 
in:
  http://code.google.com/p/minify/source/browse/trunk/min_unit_tests/_test_files/css/
vladmirated.min.css

Original comment by mrclay....@gmail.com on 14 Jan 2009 at 12:25

GoogleCodeExporter commented 9 years ago
Yes, this is one "bug" you won't have to worry about. The minifier works as
advertised when quotation marks surround the font names. I had removed the 
quotation
marks some time ago, as one of the browsers (I don't recall which one now--it's 
been
too long--but most likely IE) was choking when they were left in, refusing to 
render
the font when its name was surrounded in quotation marks. However, that is not 
the
fault of the minifier.

If you would like, you are welcome to delete my original "bug report" and this
thread. I'll figure out what I need to do to get the style sheet with quotation 
marks
working on all browsers--if indeed that is still a problem.

Original comment by mrr...@gmail.com on 14 Jan 2009 at 6:09

GoogleCodeExporter commented 9 years ago
No problem. I remember those kinds of CSS issues and I think they *have* 
thankfully 
been fixed.

Original comment by mrclay....@gmail.com on 14 Jan 2009 at 7:15

GoogleCodeExporter commented 9 years ago
By the way, I want to say "Great product!" :) My one change was to move it a
directory level deeper, and then modify all references to _minRoot in the 
_index.js
file accordingly:

var pos = location.pathname.substr(0,location.pathname.lastIndexOf('/'));
var MUB = {
    _uid : 0
    ,_minRoot : pos.substr(0,pos.lastIndexOf('/')+1)+'?';
....... etc.........

This way, it reads the current location path, simply trimming off the "builder"
directory from its end. While there are probably more elegant ways of doing the 
same
thing, this code should work no matter how many levels deep the "min" directory
lives, rather than it being hard-wired to the root. Root is often best as it 
results
in shorter URLs, but not *always* desirable for one reason or another.

Original comment by mrr...@gmail.com on 14 Jan 2009 at 10:18