Permalink
Browse files

Don't remove all whitespace before ( if it's not for URL

  • Loading branch information...
1 parent ce35bad commit 9702a6980503c24ac540500a253469604dcd9c70 @sorich87 sorich87 committed Nov 5, 2012
Showing with 10 additions and 3 deletions.
  1. +10 −3 beautify-css.js
View
@@ -161,13 +161,20 @@ function css_beautify(source_text, options) {
print.newLine();
output.push(eatComment(), "\n", indentString);
} else if (ch == '(') { // may be a url
- output.push(ch);
- eatWhitespace();
- if (lookBack("url", -1) && next()) {
+ if (lookBack("url", -1)) {
+ output.push(ch);
+ eatWhitespace();
+ if (next()) {
if (ch != ')' && ch != '"' && ch != '\'')
output.push(eatString(')'));
else
pos--;
+ }
+ } else {
+ if (isAfterSpace)
+ print.singleSpace();
+ output.push(ch);
+ eatWhitespace();
}
} else if (ch == ')') {
output.push(ch);

0 comments on commit 9702a69

Please sign in to comment.