* Fixed issue [#44](https://github.com/GoalSmashers/clean-css/issues/44) - examples in --help.
* Fixed issue [#83](https://github.com/GoalSmashers/clean-css/issues/83) - HSL to hex color conversions.
* Fixed issue [#2](https://github.com/GoalSmashers/clean-css/issues/2) - resolving @import rules.
+* Fixed issue [#80](https://github.com/GoalSmashers/clean-css/issues/80) - quotation in multi line strings.
0.10.2 / 2013-03-19
==================
};
}
+ // replace all escaped line breaks
+ replace(/\\(\r\n|\n)/mg, '');
+
// inline all imports
replace(function inlineImports() {
data = CleanCSS._inlineImports(data, {
});
// strip parentheses in urls if possible (no spaces inside)
- replace(/url\(['"]([^\)]+)['"]\)/g, function(urlMatch) {
- if (urlMatch.match(/\s/g) !== null)
- return urlMatch;
+ replace(/url\((['"])([^\)]+)['"]\)/g, function(match, quote, url) {
+ if (url.match(/[ \t]/g) !== null)
+ return 'url(' + quote + url + quote + ')';
else
- return urlMatch.replace(/\(['"]/, '(').replace(/['"]\)$/, ')');
+ return 'url(' + url + ')';
});
// strip parentheses in animation & font names
var key = content.substring(0, eqIndex);
var value = content.substring(eqIndex + 1, content.length);
- if (/^['"](?:[a-zA-Z][a-zA-Z\d\-]+)['"]$/.test(value))
+ if (/^['"](?:[a-zA-Z][a-zA-Z\d\-_]+)['"]$/.test(value))
return '[' + key + '=' + value.substring(1, value.length - 1) + ']';
else
return match;
});
replace(/__CSSFREETEXT__/g, function() {
- return context.freeTextBlocks.shift().replace(/\\(\r\n|\n)/mg, '');
+ return context.freeTextBlocks.shift();
});
var specialCommentsCount = context.specialComments.length;
.liste_reactions .bulle span{display:block;-webkit-box-shadow:0 3px 2px 1px rgba(0,11,21,.2);-moz-box-shadow:0 3px 2px 1px rgba(0,11,21,.2);box-shadow:0 3px 2px 1px rgba(0,11,21,.2);border-radius:4px;padding:10px;background:#fff}
.liste_reactions .references{font-weight:700}
.liste_reactions .references .date{color:#8b9299}
-.liste_reactions input[class=btn],.liste_reactions input[class="btn_abo"]{margin:5px 0 10px}
+.liste_reactions input[class=btn],.liste_reactions input[class=btn_abo]{margin:5px 0 10px}
.reaction_identifier,.reaction_redaction{margin:20px 0;background:#f5f8f9;border-top:3px solid #e9ecf0}
.reaction_redaction{padding:0 0 10px}
.reaction_identifier .deja_abo{float:left;width:275px;border-left:1px solid #ebeff0}
-.test[title="my very long title"]{background-image:url("very/long/path")}
\ No newline at end of file
+.test[title="my very long title"]{background-image:url(very/long/path)}
+.test[title=my_very_long_title]{background-image:url(my/very/long/path)}
\ No newline at end of file
.test[title="my very long \
title"]{background-image:url("very/long/\
-path")}
\ No newline at end of file
+path")}
+.test[title="my_very_long_\
+title"] {
+ background-image: url("my/very/long/\
+path")
+}
\ No newline at end of file
'a{background:url(/very/long/\
path)}',
'a{background:url(/very/long/path)}'
+ ],
+ 'strip new line in urls which could be unquoted': [
+ 'a{background:url("/very/long/\
+path")}',
+ 'a{background:url(/very/long/path)}'
]
}),
'fonts': cssContext({
'should keep selector if no quotation': 'div[data-type=something]{border-color:red}',
'should keep selector if equals in value': 'div[data-type="stupid=value"]{border-color:red}',
'should keep quotation if whitespace inside': 'div[data-type^=\'object 1\']{border-color:red}',
- 'should keep quotations if special characters inside': 'a[data-type="object_1"]{color:red}a[data-target="#some-place"]{color:red}',
+ 'should keep quotations if special characters inside': 'a[data-type="object+1"]{color:red}a[data-target="#some-place"]{color:red}',
'should keep quotation if is a number': 'div[data-number=\'1\']{border-color:red}',
'should keep quotation if starts with a number': 'div[data-type^=\'1something\']{border-color:red}',
'should keep quotation if starts with a hyphen': 'div[data-type$=\'-something\']{border-color:red}',
".test[title='my very long \
title']",
".test[title='my very long title']"
+ ],
+ 'should strip new lines inside attributes which can be unquoted': [
+ ".test[title='my_very_long_\
+title']",
+ ".test[title=my_very_long_title]"
]
}),
'ie filters': cssContext({