parent
ca5f8c941b
commit
90aacefff8
|
@ -1,9 +1,8 @@
|
||||||
/* global getStyleWithNoCode styleSectionsEqual */
|
/* global getStyleWithNoCode styleSectionsEqual */
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const RX_NAMESPACE = new RegExp([/[\s\r\n]*/,
|
const RX_NAMESPACE = /\s*(@namespace\s+(?:\S+\s+)?url\(http:\/\/.*?\);)\s*/g;
|
||||||
/(@namespace[\s\r\n]+(?:[^\s\r\n]+[\s\r\n]+)?url\(http:\/\/.*?\);)/,
|
const RX_CHARSET = /\s*@charset\s+(['"]).*?\1\s*;\s*/g;
|
||||||
/[\s\r\n]*/].map(rx => rx.source).join(''), 'g');
|
|
||||||
const RX_CSS_COMMENTS = /\/\*[\s\S]*?\*\//g;
|
const RX_CSS_COMMENTS = /\/\*[\s\S]*?\*\//g;
|
||||||
// eslint-disable-next-line no-var
|
// eslint-disable-next-line no-var
|
||||||
var SLOPPY_REGEXP_PREFIX = '\0';
|
var SLOPPY_REGEXP_PREFIX = '\0';
|
||||||
|
@ -541,9 +540,10 @@ function styleCodeEmpty(code) {
|
||||||
code.substr(cmtCloseLast + 2);
|
code.substr(cmtCloseLast + 2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return !code
|
if (!code || !code.trim()) return true;
|
||||||
|| !code.trim()
|
if (code.includes('@namespace')) code = code.replace(RX_NAMESPACE, '').trim();
|
||||||
|| code.includes('@namespace') && !code.replace(RX_NAMESPACE, '').trim();
|
if (code.includes('@charset')) code = code.replace(RX_CHARSET, '').trim();
|
||||||
|
return !code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user