var EscapeStore = require('./escape-store');
module.exports = function Comments(keepSpecialComments, keepBreaks, lineBreak) {
- var comments = new EscapeStore('CSSCOMMENT');
+ var comments = new EscapeStore('COMMENT');
return {
- // Strip special comments (/*! ... */) by replacing them by __CSSCOMMENT__ marker
+ // Strip special comments (/*! ... */) by replacing them by a special marker
// for further restoring. Plain comments are removed. It's done by scanning data using
// String#indexOf scanning instead of regexps to speed up the process.
escape: function(data) {
module.exports = function EscapeStore(placeholderRoot) {
+ placeholderRoot = 'ESCAPED_' + placeholderRoot + '_CLEAN_CSS';
+
var placeholderToData = {};
var dataToPlaceholder = {};
var count = 0;
};
return {
- // Escapes expressions by replacing them by the __EXPRESSION__
+ // Escapes expressions by replacing them by a special
// marker for further restoring. It's done via string scanning
// instead of regexps to speed up the process.
escape: function(data) {
var EscapeStore = require('./escape-store');
module.exports = function Free() {
- var texts = new EscapeStore('CSSFREETEXT');
+ var texts = new EscapeStore('FREE_TEXT');
var findNonEscapedEnd = function(data, matched, start) {
var end = start;
};
return {
- // Strip content tags by replacing them by the __CSSFREETEXT__
+ // Strip content tags by replacing them by the a special
// marker for further restoring. It's done via string scanning
// instead of regexps to speed up the process.
escape: function(data) {
var urls = new EscapeStore('URL');
return {
- // Strip urls by replacing them by the __URL__
+ // Strip urls by replacing them by a special
// marker for further restoring. It's done via string scanning
// instead of regexps to speed up the process.
escape: function(data) {
'keep urls from being stripped down #1': 'a{background:url(/image-1.0.png)}',
'keep urls from being stripped down #2': "a{background:url(/image-white.png)}",
'keep urls from being stripped down #3': "a{background:#eee url(/libraries/jquery-ui-1.10.1.custom/images/ui-bg_highlight-soft_100_eeeeee_1x100.png) 50% top repeat-x}",
- 'keep __URL__ in comments (so order is important)': '/*! __URL__ */a{display:block}',
+ 'keep special markers in comments (so order is important)': '/*! __ESCAPED_URL_CLEAN_CSS0__ */a{display:block}',
'strip new line in urls': [
'a{background:url(/very/long/\
path)}',