[3.4.4 / 2015-xx-xx](https://github.com/jakubpawlowicz/clean-css/compare/v3.4.3...3.4)
==================
+* Fixed issue [#626](https://github.com/jakubpawlowicz/clean-css/issues/626) - edge case in import rebasing.
* Fixed issue [#674](https://github.com/jakubpawlowicz/clean-css/issues/674) - adjacent merging order.
[3.4.3 / 2015-09-15](https://github.com/jakubpawlowicz/clean-css/compare/v3.4.2...v3.4.3)
var IMPORT_URL_PREFIX = '@import';
var UPPERCASE_IMPORT_URL_PREFIX = '@IMPORT';
+var COMMENT_END_MARKER = /\*\//;
+
function byUrl(data, context, callback) {
var nextStart = 0;
var nextStartUpperCase = 0;
nextEnd = data.indexOf(withQuote, nextStart + 1);
untilNextQuote = data.substring(nextImport, nextEnd);
- if (nextEnd == -1 || /^@import\s+(url\(|__ESCAPED)/i.test(untilNextQuote)) {
+ if (nextEnd == -1 || /^@import\s+(url\(|__ESCAPED)/i.test(untilNextQuote) || COMMENT_END_MARKER.test(untilNextQuote)) {
cursor = nextStart;
break;
}
--- /dev/null
+/* @import */
+@font-face{font-family:"Font";src:url("/path/to/font")}
});
}
},
+ 'local imports': {
+ 'inside a comment preceding a quote': {
+ 'topic': function () {
+ new CleanCSS().minify('@import "test/fixtures/partials/with-commented-import.css";', this.callback);
+ },
+ 'has right output': function (errors, minified) {
+ assert.equal(minified.styles, '@font-face{font-family:Font;src:url(/path/to/font)}');
+ }
+ }
+ },
'external imports and no callback': {
'without content': {
'topic': function () {
assert.equal(minified.styles, '.one{color:red}.three{color:#0f0}.four{color:#00f}.two{color:#fff}');
}
},
- 'with two import URLs when one is a string plus a callback 123': {
+ 'with two import URLs when one is a string plus a callback': {
'topic': function () {
new CleanCSS().minify({
'main.css': {