if (comment.indexOf(SPECIAL_COMMENT_PREFIX) === 0 && (this.keepAll || (this.keepOne && restored === 0))) {
restored++;
- addBreak = this.keepBreaks && data[nextMatch.end] != '\n' && data[nextMatch.end] != '\r\n';
+ addBreak = this.keepBreaks && data[nextMatch.end] != '\n' && data.lastIndexOf('\r\n', nextMatch.end + 1) != nextMatch.end;
tempData.push(comment, addBreak ? lineBreak : '');
} else {
- nextMatch.end += this.keepBreaks ? 1 : 0;
+ nextMatch.end += this.keepBreaks ? lineBreak.length : 0;
}
cursor = nextMatch.end;
var CommentsProcessor = require('../../lib/text/comments-processor');
var lineBreak = require('os').EOL;
+var otherLineBreak = lineBreak == '\n' ? '\r\n' : '\n';
function processorContext(name, context, keepSpecialComments, keepBreaks) {
var vowContext = {};
'a{}/*! some text */' + lineBreak + 'p{}',
'a{}__ESCAPED_COMMENT_CLEAN_CSS0__' + lineBreak + 'p{}',
'a{}/*! some text */' + lineBreak + 'p{}'
+ ],
+ 'if given an other platform break already': [
+ 'a{}/*! some text */' + otherLineBreak + 'p{}',
+ 'a{}__ESCAPED_COMMENT_CLEAN_CSS0__' + otherLineBreak + 'p{}',
+ 'a{}/*! some text */' + otherLineBreak + 'p{}'
]
}, '1', true)
)