});
var specialCommentsCount = context.specialComments.length;
- replace(/__CSSCOMMENT__/g, function() {
+ var breakSuffix = options.keepBreaks ? lineBreak : '';
+ replace(new RegExp('__CSSCOMMENT__(' + lineBreak + ')?', 'g'), function() {
switch (options.keepSpecialComments) {
case '*':
- return context.specialComments.shift();
+ return context.specialComments.shift() + breakSuffix;
case 1:
return context.specialComments.length == specialCommentsCount ?
- context.specialComments.shift() :
+ context.specialComments.shift() + breakSuffix :
'';
case 0:
return '';
"@charset 'utf-8';" + lineBreak + "a{}"
]
}, { keepBreaks: true }),
+ 'line breaks and important comments': cssContext({
+ 'charset to beginning with comment removal': [
+ "/*! some comment */" + lineBreak + lineBreak + "@charset 'utf-8';" + lineBreak + lineBreak + "a{}",
+ "@charset 'utf-8';" + lineBreak + "a{}"
+ ]
+ }, { keepBreaks: true, keepSpecialComments: 0 }),
'selectors': cssContext({
'remove spaces around selectors': [
'div + span > em',