* Fixed issue [#130](https://github.com/GoalSmashers/clean-css/issues/130) - better code modularity.
* Fixed issue [#135](https://github.com/GoalSmashers/clean-css/issues/135) - require node.js 0.8+.
* Renamed lib's `debug` option to `benchmark` when doing per-minification benchmarking.
+* Added simplified comments processing & imports.
1.0.12 / 2013-07-19
===================
var urlsProcessor = new UrlsProcessor();
var importInliner = new ImportInliner();
- var removeComments = function() {
- replace(function escapeComments() {
- data = commentsProcessor.escape(data);
- });
- };
-
- removeComments();
-
- // replace all escaped line breaks
- replace(/\\(\r\n|\n)/mg, '');
-
if (options.processImport) {
// inline all imports
replace(function inlineImports() {
relativeTo: options.relativeTo
});
});
-
- // strip comments with inlined imports
- if (data.indexOf('/*') > -1)
- removeComments();
}
+ replace(function escapeComments() {
+ data = commentsProcessor.escape(data);
+ });
+
+ // replace all escaped line breaks
+ replace(/\\(\r\n|\n)/mg, '');
+
// strip parentheses in urls if possible (no spaces inside)
replace(/url\((['"])([^\)]+)['"]\)/g, function(match, quote, url) {
if (url.match(/[ \t]/g) !== null || url.indexOf('data:') === 0)
".five{background:url(data:image/jpeg;base64,/9j/)}"
],
'inside a comment': [
- '/* @import */a { color: red; }',
+ '/* @import url(test/data/partials/five.css); */a { color: red; }',
'a{color:red}'
],
'of a file with a comment': [