diff --git a/edit/sections-editor.js b/edit/sections-editor.js index 51f55769..ab9d7651 100644 --- a/edit/sections-editor.js +++ b/edit/sections-editor.js @@ -622,7 +622,7 @@ function SectionsEditor() { const text = event.clipboardData.getData('text') || ''; if (/@-moz-document/i.test(text) && /@-moz-document\s+(url|url-prefix|domain|regexp)\(/i - .test(text.replace(/\/\*([^*]|\*(?!\/))*(\*\/|$)/g, '')) + .test(text.replace(/\/\*([^*]+|\*(?!\/))*(\*\/|$)/g, '')) ) { event.preventDefault(); showMozillaFormatImport(text); diff --git a/js/color/color-view.js b/js/color/color-view.js index da4610c3..14e8b7c5 100644 --- a/js/color/color-view.js +++ b/js/color/color-view.js @@ -29,7 +29,7 @@ '(?=[\\s;(){}[\\]/"!]|$)' + ')', 'gi'); const RX_DETECT_FUNC = /((rgb|hsl)a?|hwb)\(/iy; - const RX_COMMENT = /\/\*([^*]|\*(?!\/))*(\*\/|$)/g; + const RX_COMMENT = /\/\*([^*]+|\*(?!\/))*(\*\/|$)/g; const SPACE1K = ' '.repeat(1000); // milliseconds to work on invisible colors per one run diff --git a/js/csslint/csslint.js b/js/csslint/csslint.js index 012e66d7..4c2d160d 100644 --- a/js/csslint/csslint.js +++ b/js/csslint/csslint.js @@ -112,7 +112,7 @@ class Reporter { //eslint-disable-next-line no-var var CSSLint = (() => { - const RX_EMBEDDED = /\/\*\s*csslint\s+((?:[^*]|\*(?!\/))+?)\*\//ig; + const RX_EMBEDDED = /\/\*\s*csslint\s+((?:[^*]+|\*(?!\/))+?)\*\//ig; const EBMEDDED_RULE_VALUE_MAP = { // error 'true': 2, diff --git a/js/csslint/parserlib.js b/js/csslint/parserlib.js index da515330..64319e32 100644 --- a/js/csslint/parserlib.js +++ b/js/csslint/parserlib.js @@ -3104,7 +3104,7 @@ self.parserlib = (() => { readComment(first) { return first + this._reader.readCount(2 - first.length) + - this._reader.readMatch(/([^*]|\*(?!\/))*(\*\/|$)/y); + this._reader.readMatch(/([^*]+|\*(?!\/))*(\*\/|$)/y); } /** diff --git a/js/sections-util.js b/js/sections-util.js index f9e679ab..1e21aac1 100644 --- a/js/sections-util.js +++ b/js/sections-util.js @@ -72,7 +72,7 @@ function styleCodeEmpty(code) { return true; } let lastIndex = 0; - const rx = /\s+|\/\*([^*]|\*(?!\/))*(\*\/|$)|@namespace[^;]+;|@charset[^;]+;/giyu; + const rx = /\s+|\/\*([^*]+|\*(?!\/))*(\*\/|$)|@namespace[^;]+;|@charset[^;]+;/giyu; while (rx.exec(code)) { lastIndex = rx.lastIndex; if (lastIndex === code.length) { diff --git a/tools/test.js b/tools/test.js index f2fc3568..c034cf7d 100644 --- a/tools/test.js +++ b/tools/test.js @@ -8,7 +8,7 @@ function testGlobalCss() { const css = fs.readFileSync('global.css', {encoding: 'utf8'}); const ERR = 'global.css: missing the transition suppressor rule'; const RX_SUPPRESSOR = /[^{}]+#\\1\s?transition-suppressor[^{}]+{\s*transition:\s*none\s*!\s*important/i; - const RX_COMMENT = /\/\*([^*]|\*(?!\/))*(\*\/|$)/g; + const RX_COMMENT = /\/\*([^*]+|\*(?!\/))*(\*\/|$)/g; if (!RX_SUPPRESSOR.test(css.replace(RX_COMMENT, ''))) { console.error(ERR); process.exit(1);