From b42d44d5624e21d1bddfc64dd485691da410871f Mon Sep 17 00:00:00 2001 From: "murthy.pattisapu" Date: Tue, 4 Feb 2020 11:41:28 +0530 Subject: [PATCH 1/6] added testcase for large less file --- test/JavaScript.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/JavaScript.js b/test/JavaScript.js index c2a3cea..292808a 100644 --- a/test/JavaScript.js +++ b/test/JavaScript.js @@ -16,6 +16,13 @@ const tests = path.join.bind(path, __dirname); const read = src => fs.readFileSync(src, 'utf-8').replace(/\r*\n/g, '\n');; describe('JavaScript comments', () => { + it('should work on large content files', () => { + const file = read(tests('fixtures/large.less')); + const generated = strip(file, {language : 'less'}); + const stripped = read(tests('expected/strip-large.less')); + assert.strictEqual(stripped, generated); + }); + it('should strip all comments', () => { const actual = strip("'foo'; // this is a comment\n/* me too */ var abc = 'xyz';"); assert.strictEqual(actual, '\'foo\'; \n var abc = \'xyz\';'); From 83ed581443dc8c5343e570ddefa071ee35fd8744 Mon Sep 17 00:00:00 2001 From: "murthy.pattisapu" Date: Tue, 4 Feb 2020 15:06:44 +0530 Subject: [PATCH 2/6] Adding actual less test files --- test/expected/strip-large.less | 292 +++++++++++++++++++++++++++++ test/fixtures/large.less | 331 +++++++++++++++++++++++++++++++++ 2 files changed, 623 insertions(+) create mode 100644 test/expected/strip-large.less create mode 100644 test/fixtures/large.less diff --git a/test/expected/strip-large.less b/test/expected/strip-large.less new file mode 100644 index 0000000..ac0b4ee --- /dev/null +++ b/test/expected/strip-large.less @@ -0,0 +1,292 @@ +@noUi-css-prefix: noUi; + + + + + +.@{noUi-css-prefix}-target, +.@{noUi-css-prefix}-target * { +-webkit-touch-callout: none; +-webkit-tap-highlight-color: rgba(0,0,0,0); +-webkit-user-select: none; +-ms-touch-action: none; + touch-action: none; +-ms-user-select: none; +-moz-user-select: none; + user-select: none; +-moz-box-sizing: border-box; + box-sizing: border-box; +} +.@{noUi-css-prefix}-target { + position: relative; + direction: ltr; +} +.@{noUi-css-prefix}-base { + width: 100%; + height: 100%; + position: relative; + z-index: 1; } +.@{noUi-css-prefix}-connect { + position: absolute; + right: 0; + top: 0; + left: 0; + bottom: 0; +} +.@{noUi-css-prefix}-origin { + position: absolute; + height: 0; + width: 0; +} +.@{noUi-css-prefix}-handle { + position: relative; + z-index: 1; +} +.@{noUi-css-prefix}-state-tap .@{noUi-css-prefix}-connect, +.@{noUi-css-prefix}-state-tap .@{noUi-css-prefix}-origin { +-webkit-transition: top 0.3s, right 0.3s, bottom 0.3s, left 0.3s; + transition: top 0.3s, right 0.3s, bottom 0.3s, left 0.3s; +} +.@{noUi-css-prefix}-state-drag * { + cursor: inherit !important; +} + +.@{noUi-css-prefix}-base, +.@{noUi-css-prefix}-handle { + -webkit-transform: translate3d(0,0,0); + transform: translate3d(0,0,0); +} + +.@{noUi-css-prefix}-horizontal { + height: 18px; +} +.@{noUi-css-prefix}-horizontal .@{noUi-css-prefix}-handle { + width: 34px; + height: 28px; + left: -17px; + top: -6px; +} +.@{noUi-css-prefix}-vertical { + width: 18px; +} +.@{noUi-css-prefix}-vertical .@{noUi-css-prefix}-handle { + width: 28px; + height: 34px; + left: -6px; + top: -17px; +} + +.@{noUi-css-prefix}-target { + background: #FAFAFA; + border-radius: 4px; + border: 1px solid #D3D3D3; + box-shadow: inset 0 1px 1px #F0F0F0, 0 3px 6px -5px #BBB; +} +.@{noUi-css-prefix}-connect { + background: #3FB8AF; + box-shadow: inset 0 0 3px rgba(51,51,51,0.45); +-webkit-transition: background 450ms; + transition: background 450ms; +} + +.@{noUi-css-prefix}-draggable { + cursor: ew-resize; +} +.@{noUi-css-prefix}-vertical .@{noUi-css-prefix}-draggable { + cursor: ns-resize; +} +.@{noUi-css-prefix}-handle { + border: 1px solid #D9D9D9; + border-radius: 3px; + background: #FFF; + cursor: default; + box-shadow: inset 0 0 1px #FFF, + inset 0 1px 7px #EBEBEB, + 0 3px 6px -3px #BBB; +} +.@{noUi-css-prefix}-active { + box-shadow: inset 0 0 1px #FFF, + inset 0 1px 7px #DDD, + 0 3px 6px -3px #BBB; +} + +.@{noUi-css-prefix}-handle:before, +.@{noUi-css-prefix}-handle:after { + content: ""; + display: block; + position: absolute; + height: 14px; + width: 1px; + background: #E8E7E6; + left: 14px; + top: 6px; +} +.@{noUi-css-prefix}-handle:after { + left: 17px; +} +.@{noUi-css-prefix}-vertical .@{noUi-css-prefix}-handle:before, +.@{noUi-css-prefix}-vertical .@{noUi-css-prefix}-handle:after { + width: 14px; + height: 1px; + left: 6px; + top: 14px; +} +.@{noUi-css-prefix}-vertical .@{noUi-css-prefix}-handle:after { + top: 17px; +} + + +[disabled] .@{noUi-css-prefix}-connect { + background: #B8B8B8; +} +[disabled].@{noUi-css-prefix}-target, +[disabled].@{noUi-css-prefix}-handle, +[disabled] .@{noUi-css-prefix}-handle { + cursor: not-allowed; +} + + + +.@{noUi-css-prefix}-pips, +.@{noUi-css-prefix}-pips * { +-moz-box-sizing: border-box; + box-sizing: border-box; +} +.@{noUi-css-prefix}-pips { + position: absolute; + color: #999; +} + +.@{noUi-css-prefix}-value { + position: absolute; + text-align: center; +} +.@{noUi-css-prefix}-value-sub { + color: #ccc; + font-size: 10px; +} + +.@{noUi-css-prefix}-marker { + position: absolute; + background: #CCC; +} +.@{noUi-css-prefix}-marker-sub { + background: #AAA; +} +.@{noUi-css-prefix}-marker-large { + background: #AAA; +} + +.@{noUi-css-prefix}-pips-horizontal { + padding: 10px 0; + height: 80px; + top: 100%; + left: 0; + width: 100%; +} +.@{noUi-css-prefix}-value-horizontal { + -webkit-transform: translate3d(-50%,50%,0); + transform: translate3d(-50%,50%,0); +} + +.@{noUi-css-prefix}-marker-horizontal.@{noUi-css-prefix}-marker { + margin-left: -1px; + width: 2px; + height: 5px; +} +.@{noUi-css-prefix}-marker-horizontal.@{noUi-css-prefix}-marker-sub { + height: 10px; +} +.@{noUi-css-prefix}-marker-horizontal.@{noUi-css-prefix}-marker-large { + height: 15px; +} + +.@{noUi-css-prefix}-pips-vertical { + padding: 0 10px; + height: 100%; + top: 0; + left: 100%; +} +.@{noUi-css-prefix}-value-vertical { + -webkit-transform: translate3d(0,50%,0); + transform: translate3d(0,50%,0); + padding-left: 25px; +} + +.@{noUi-css-prefix}-marker-vertical.@{noUi-css-prefix}-marker { + width: 5px; + height: 2px; + margin-top: -1px; +} +.@{noUi-css-prefix}-marker-vertical.@{noUi-css-prefix}-marker-sub { + width: 10px; +} +.@{noUi-css-prefix}-marker-vertical.@{noUi-css-prefix}-marker-large { + width: 15px; +} + + +.@{noUi-css-prefix}-tooltip { + display: block; + position: absolute; + border: 1px solid #D9D9D9; + border-radius: 3px; + background: #fff; + color: #000; + padding: 5px; + text-align: center; +} +.@{noUi-css-prefix}-horizontal .@{noUi-css-prefix}-tooltip { +-webkit-transform: translate(-50%, 0); + transform: translate(-50%, 0); + left: 50%; + bottom: 120%; +} +.@{noUi-css-prefix}-vertical .@{noUi-css-prefix}-tooltip { +-webkit-transform: translate(0, -50%); + transform: translate(0, -50%); + top: 50%; + right: 120%; +} + + + + +.ph-range-slider-v1-default-default { + padding: @space-lg 0; + .noUi-horizontal, + .noUi-vertical { + height: 6px; + .noUi-handle { + width: 20px; + height: 20px; + left: -17px; + top: -9px; + } + } + .noUi-vertical{ + width: 6px; + } + .noUi-target { + background: #d7d7d7; + border-radius: 10px; + border: 1px solid #d7d7d7; + box-shadow: none; + } + .noUi-connect { + background: #c3c4c4; + box-shadow: none; + } + .noUi-handle { + border-radius: 50%; + border: 1px solid #d4d7d7; + background-color: #e1e1e1; + cursor: default; + box-shadow: none; + &:after, + &:before{ + content: ''; + display: none; + } + } +} diff --git a/test/fixtures/large.less b/test/fixtures/large.less new file mode 100644 index 0000000..1af7190 --- /dev/null +++ b/test/fixtures/large.less @@ -0,0 +1,331 @@ +@noUi-css-prefix: noUi; + + +/* Start for non editable less */ + +/* @import "nouislider.core.less"; + * Functional styling; + * These styles are required for noUiSlider to function. + * You don't need to change these rules to apply your design. + */ + + +.@{noUi-css-prefix}-target, +.@{noUi-css-prefix}-target * { +-webkit-touch-callout: none; +-webkit-tap-highlight-color: rgba(0,0,0,0); +-webkit-user-select: none; +-ms-touch-action: none; + touch-action: none; +-ms-user-select: none; +-moz-user-select: none; + user-select: none; +-moz-box-sizing: border-box; + box-sizing: border-box; +} +.@{noUi-css-prefix}-target { + position: relative; + direction: ltr; +} +.@{noUi-css-prefix}-base { + width: 100%; + height: 100%; + position: relative; + z-index: 1; /* Fix 401 */ +} +.@{noUi-css-prefix}-connect { + position: absolute; + right: 0; + top: 0; + left: 0; + bottom: 0; +} +.@{noUi-css-prefix}-origin { + position: absolute; + height: 0; + width: 0; +} +.@{noUi-css-prefix}-handle { + position: relative; + z-index: 1; +} +.@{noUi-css-prefix}-state-tap .@{noUi-css-prefix}-connect, +.@{noUi-css-prefix}-state-tap .@{noUi-css-prefix}-origin { +-webkit-transition: top 0.3s, right 0.3s, bottom 0.3s, left 0.3s; + transition: top 0.3s, right 0.3s, bottom 0.3s, left 0.3s; +} +.@{noUi-css-prefix}-state-drag * { + cursor: inherit !important; +} + +/* Painting and performance; + * Browsers can paint handles in their own layer. + */ +.@{noUi-css-prefix}-base, +.@{noUi-css-prefix}-handle { + -webkit-transform: translate3d(0,0,0); + transform: translate3d(0,0,0); +} + +/* Slider size and handle placement; + */ +.@{noUi-css-prefix}-horizontal { + height: 18px; +} +.@{noUi-css-prefix}-horizontal .@{noUi-css-prefix}-handle { + width: 34px; + height: 28px; + left: -17px; + top: -6px; +} +.@{noUi-css-prefix}-vertical { + width: 18px; +} +.@{noUi-css-prefix}-vertical .@{noUi-css-prefix}-handle { + width: 28px; + height: 34px; + left: -6px; + top: -17px; +} + +/* Styling; + */ +.@{noUi-css-prefix}-target { + background: #FAFAFA; + border-radius: 4px; + border: 1px solid #D3D3D3; + box-shadow: inset 0 1px 1px #F0F0F0, 0 3px 6px -5px #BBB; +} +.@{noUi-css-prefix}-connect { + background: #3FB8AF; + box-shadow: inset 0 0 3px rgba(51,51,51,0.45); +-webkit-transition: background 450ms; + transition: background 450ms; +} + +/* Handles and cursors; + */ +.@{noUi-css-prefix}-draggable { + cursor: ew-resize; +} +.@{noUi-css-prefix}-vertical .@{noUi-css-prefix}-draggable { + cursor: ns-resize; +} +.@{noUi-css-prefix}-handle { + border: 1px solid #D9D9D9; + border-radius: 3px; + background: #FFF; + cursor: default; + box-shadow: inset 0 0 1px #FFF, + inset 0 1px 7px #EBEBEB, + 0 3px 6px -3px #BBB; +} +.@{noUi-css-prefix}-active { + box-shadow: inset 0 0 1px #FFF, + inset 0 1px 7px #DDD, + 0 3px 6px -3px #BBB; +} + +/* Handle stripes; + */ +.@{noUi-css-prefix}-handle:before, +.@{noUi-css-prefix}-handle:after { + content: ""; + display: block; + position: absolute; + height: 14px; + width: 1px; + background: #E8E7E6; + left: 14px; + top: 6px; +} +.@{noUi-css-prefix}-handle:after { + left: 17px; +} +.@{noUi-css-prefix}-vertical .@{noUi-css-prefix}-handle:before, +.@{noUi-css-prefix}-vertical .@{noUi-css-prefix}-handle:after { + width: 14px; + height: 1px; + left: 6px; + top: 14px; +} +.@{noUi-css-prefix}-vertical .@{noUi-css-prefix}-handle:after { + top: 17px; +} + +/* Disabled state; + */ + +[disabled] .@{noUi-css-prefix}-connect { + background: #B8B8B8; +} +[disabled].@{noUi-css-prefix}-target, +[disabled].@{noUi-css-prefix}-handle, +[disabled] .@{noUi-css-prefix}-handle { + cursor: not-allowed; +} + +/*@import "nouislider.pips.less";*/ + + +/* Base; + * + */ +.@{noUi-css-prefix}-pips, +.@{noUi-css-prefix}-pips * { +-moz-box-sizing: border-box; + box-sizing: border-box; +} +.@{noUi-css-prefix}-pips { + position: absolute; + color: #999; +} + +/* Values; + * + */ +.@{noUi-css-prefix}-value { + position: absolute; + text-align: center; +} +.@{noUi-css-prefix}-value-sub { + color: #ccc; + font-size: 10px; +} + +/* Markings; + * + */ +.@{noUi-css-prefix}-marker { + position: absolute; + background: #CCC; +} +.@{noUi-css-prefix}-marker-sub { + background: #AAA; +} +.@{noUi-css-prefix}-marker-large { + background: #AAA; +} + +/* Horizontal layout; + * + */ +.@{noUi-css-prefix}-pips-horizontal { + padding: 10px 0; + height: 80px; + top: 100%; + left: 0; + width: 100%; +} +.@{noUi-css-prefix}-value-horizontal { + -webkit-transform: translate3d(-50%,50%,0); + transform: translate3d(-50%,50%,0); +} + +.@{noUi-css-prefix}-marker-horizontal.@{noUi-css-prefix}-marker { + margin-left: -1px; + width: 2px; + height: 5px; +} +.@{noUi-css-prefix}-marker-horizontal.@{noUi-css-prefix}-marker-sub { + height: 10px; +} +.@{noUi-css-prefix}-marker-horizontal.@{noUi-css-prefix}-marker-large { + height: 15px; +} + +/* Vertical layout; + * + */ +.@{noUi-css-prefix}-pips-vertical { + padding: 0 10px; + height: 100%; + top: 0; + left: 100%; +} +.@{noUi-css-prefix}-value-vertical { + -webkit-transform: translate3d(0,50%,0); + transform: translate3d(0,50%,0); + padding-left: 25px; +} + +.@{noUi-css-prefix}-marker-vertical.@{noUi-css-prefix}-marker { + width: 5px; + height: 2px; + margin-top: -1px; +} +.@{noUi-css-prefix}-marker-vertical.@{noUi-css-prefix}-marker-sub { + width: 10px; +} +.@{noUi-css-prefix}-marker-vertical.@{noUi-css-prefix}-marker-large { + width: 15px; +} + +/* @import "nouislider.tooltips.less"; */ + +.@{noUi-css-prefix}-tooltip { + display: block; + position: absolute; + border: 1px solid #D9D9D9; + border-radius: 3px; + background: #fff; + color: #000; + padding: 5px; + text-align: center; +} +.@{noUi-css-prefix}-horizontal .@{noUi-css-prefix}-tooltip { +-webkit-transform: translate(-50%, 0); + transform: translate(-50%, 0); + left: 50%; + bottom: 120%; +} +.@{noUi-css-prefix}-vertical .@{noUi-css-prefix}-tooltip { +-webkit-transform: translate(0, -50%); + transform: translate(0, -50%); + top: 50%; + right: 120%; +} + + +/* END for non editable less */ + +/* If want Remove below css and wirte new */ + +.ph-range-slider-v1-default-default { + padding: @space-lg 0; + .noUi-horizontal, + .noUi-vertical { + height: 6px; + .noUi-handle { + width: 20px; + height: 20px; + left: -17px; + top: -9px; + } + } + .noUi-vertical{ + width: 6px; + } + .noUi-target { + background: #d7d7d7; + border-radius: 10px; + border: 1px solid #d7d7d7; + box-shadow: none; + } + .noUi-connect { + background: #c3c4c4; + box-shadow: none; + } + .noUi-handle { + border-radius: 50%; + border: 1px solid #d4d7d7; + background-color: #e1e1e1; + cursor: default; + box-shadow: none; + &:after, + &:before{ + content: ''; + display: none; + } + } +} From bd56cc11140f04f6736f52f5b25c8a1de1b3413a Mon Sep 17 00:00:00 2001 From: Pradeepa__Anumalla Date: Wed, 5 Feb 2020 13:59:12 +0530 Subject: [PATCH 3/6] Regex changes for quoted string --- lib/parse.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/parse.js b/lib/parse.js index 1097ba3..d334e9d 100644 --- a/lib/parse.js +++ b/lib/parse.js @@ -5,7 +5,7 @@ const languages = require('./languages'); const constants = { ESCAPED_CHAR_REGEX: /^\\./, - QUOTED_STRING_REGEX: /^(['"`])((?:\\.|[^\1])+?)(\1)/, + QUOTED_STRING_REGEX:/^(['"`])((?:|[^\1])+?)(\1)/, NEWLINE_REGEX: /^\r*\n/ }; From 352205714b97e0102ead655b4abbcaead77c9984 Mon Sep 17 00:00:00 2001 From: "murthy.pattisapu" Date: Wed, 5 Feb 2020 16:57:05 +0530 Subject: [PATCH 4/6] Modfying less testcase to exact scenario - Empty qoutes are causing the issue in removing comments --- test/JavaScript.js | 6 +- test/expected/strip-large.less | 292 ----------------- test/expected/strip-quoted-sting-match.less | 10 + test/fixtures/large.less | 331 -------------------- test/fixtures/quoted-sting-match.less | 12 + 5 files changed, 25 insertions(+), 626 deletions(-) delete mode 100644 test/expected/strip-large.less create mode 100644 test/expected/strip-quoted-sting-match.less delete mode 100644 test/fixtures/large.less create mode 100644 test/fixtures/quoted-sting-match.less diff --git a/test/JavaScript.js b/test/JavaScript.js index 292808a..ba8cb2a 100644 --- a/test/JavaScript.js +++ b/test/JavaScript.js @@ -16,10 +16,10 @@ const tests = path.join.bind(path, __dirname); const read = src => fs.readFileSync(src, 'utf-8').replace(/\r*\n/g, '\n');; describe('JavaScript comments', () => { - it('should work on large content files', () => { - const file = read(tests('fixtures/large.less')); + it('should work on comments which has quotes', () => { + const file = read(tests('fixtures/quoted-sting-match.less')); const generated = strip(file, {language : 'less'}); - const stripped = read(tests('expected/strip-large.less')); + const stripped = read(tests('expected/strip-quoted-sting-match.less')); assert.strictEqual(stripped, generated); }); diff --git a/test/expected/strip-large.less b/test/expected/strip-large.less deleted file mode 100644 index ac0b4ee..0000000 --- a/test/expected/strip-large.less +++ /dev/null @@ -1,292 +0,0 @@ -@noUi-css-prefix: noUi; - - - - - -.@{noUi-css-prefix}-target, -.@{noUi-css-prefix}-target * { --webkit-touch-callout: none; --webkit-tap-highlight-color: rgba(0,0,0,0); --webkit-user-select: none; --ms-touch-action: none; - touch-action: none; --ms-user-select: none; --moz-user-select: none; - user-select: none; --moz-box-sizing: border-box; - box-sizing: border-box; -} -.@{noUi-css-prefix}-target { - position: relative; - direction: ltr; -} -.@{noUi-css-prefix}-base { - width: 100%; - height: 100%; - position: relative; - z-index: 1; } -.@{noUi-css-prefix}-connect { - position: absolute; - right: 0; - top: 0; - left: 0; - bottom: 0; -} -.@{noUi-css-prefix}-origin { - position: absolute; - height: 0; - width: 0; -} -.@{noUi-css-prefix}-handle { - position: relative; - z-index: 1; -} -.@{noUi-css-prefix}-state-tap .@{noUi-css-prefix}-connect, -.@{noUi-css-prefix}-state-tap .@{noUi-css-prefix}-origin { --webkit-transition: top 0.3s, right 0.3s, bottom 0.3s, left 0.3s; - transition: top 0.3s, right 0.3s, bottom 0.3s, left 0.3s; -} -.@{noUi-css-prefix}-state-drag * { - cursor: inherit !important; -} - -.@{noUi-css-prefix}-base, -.@{noUi-css-prefix}-handle { - -webkit-transform: translate3d(0,0,0); - transform: translate3d(0,0,0); -} - -.@{noUi-css-prefix}-horizontal { - height: 18px; -} -.@{noUi-css-prefix}-horizontal .@{noUi-css-prefix}-handle { - width: 34px; - height: 28px; - left: -17px; - top: -6px; -} -.@{noUi-css-prefix}-vertical { - width: 18px; -} -.@{noUi-css-prefix}-vertical .@{noUi-css-prefix}-handle { - width: 28px; - height: 34px; - left: -6px; - top: -17px; -} - -.@{noUi-css-prefix}-target { - background: #FAFAFA; - border-radius: 4px; - border: 1px solid #D3D3D3; - box-shadow: inset 0 1px 1px #F0F0F0, 0 3px 6px -5px #BBB; -} -.@{noUi-css-prefix}-connect { - background: #3FB8AF; - box-shadow: inset 0 0 3px rgba(51,51,51,0.45); --webkit-transition: background 450ms; - transition: background 450ms; -} - -.@{noUi-css-prefix}-draggable { - cursor: ew-resize; -} -.@{noUi-css-prefix}-vertical .@{noUi-css-prefix}-draggable { - cursor: ns-resize; -} -.@{noUi-css-prefix}-handle { - border: 1px solid #D9D9D9; - border-radius: 3px; - background: #FFF; - cursor: default; - box-shadow: inset 0 0 1px #FFF, - inset 0 1px 7px #EBEBEB, - 0 3px 6px -3px #BBB; -} -.@{noUi-css-prefix}-active { - box-shadow: inset 0 0 1px #FFF, - inset 0 1px 7px #DDD, - 0 3px 6px -3px #BBB; -} - -.@{noUi-css-prefix}-handle:before, -.@{noUi-css-prefix}-handle:after { - content: ""; - display: block; - position: absolute; - height: 14px; - width: 1px; - background: #E8E7E6; - left: 14px; - top: 6px; -} -.@{noUi-css-prefix}-handle:after { - left: 17px; -} -.@{noUi-css-prefix}-vertical .@{noUi-css-prefix}-handle:before, -.@{noUi-css-prefix}-vertical .@{noUi-css-prefix}-handle:after { - width: 14px; - height: 1px; - left: 6px; - top: 14px; -} -.@{noUi-css-prefix}-vertical .@{noUi-css-prefix}-handle:after { - top: 17px; -} - - -[disabled] .@{noUi-css-prefix}-connect { - background: #B8B8B8; -} -[disabled].@{noUi-css-prefix}-target, -[disabled].@{noUi-css-prefix}-handle, -[disabled] .@{noUi-css-prefix}-handle { - cursor: not-allowed; -} - - - -.@{noUi-css-prefix}-pips, -.@{noUi-css-prefix}-pips * { --moz-box-sizing: border-box; - box-sizing: border-box; -} -.@{noUi-css-prefix}-pips { - position: absolute; - color: #999; -} - -.@{noUi-css-prefix}-value { - position: absolute; - text-align: center; -} -.@{noUi-css-prefix}-value-sub { - color: #ccc; - font-size: 10px; -} - -.@{noUi-css-prefix}-marker { - position: absolute; - background: #CCC; -} -.@{noUi-css-prefix}-marker-sub { - background: #AAA; -} -.@{noUi-css-prefix}-marker-large { - background: #AAA; -} - -.@{noUi-css-prefix}-pips-horizontal { - padding: 10px 0; - height: 80px; - top: 100%; - left: 0; - width: 100%; -} -.@{noUi-css-prefix}-value-horizontal { - -webkit-transform: translate3d(-50%,50%,0); - transform: translate3d(-50%,50%,0); -} - -.@{noUi-css-prefix}-marker-horizontal.@{noUi-css-prefix}-marker { - margin-left: -1px; - width: 2px; - height: 5px; -} -.@{noUi-css-prefix}-marker-horizontal.@{noUi-css-prefix}-marker-sub { - height: 10px; -} -.@{noUi-css-prefix}-marker-horizontal.@{noUi-css-prefix}-marker-large { - height: 15px; -} - -.@{noUi-css-prefix}-pips-vertical { - padding: 0 10px; - height: 100%; - top: 0; - left: 100%; -} -.@{noUi-css-prefix}-value-vertical { - -webkit-transform: translate3d(0,50%,0); - transform: translate3d(0,50%,0); - padding-left: 25px; -} - -.@{noUi-css-prefix}-marker-vertical.@{noUi-css-prefix}-marker { - width: 5px; - height: 2px; - margin-top: -1px; -} -.@{noUi-css-prefix}-marker-vertical.@{noUi-css-prefix}-marker-sub { - width: 10px; -} -.@{noUi-css-prefix}-marker-vertical.@{noUi-css-prefix}-marker-large { - width: 15px; -} - - -.@{noUi-css-prefix}-tooltip { - display: block; - position: absolute; - border: 1px solid #D9D9D9; - border-radius: 3px; - background: #fff; - color: #000; - padding: 5px; - text-align: center; -} -.@{noUi-css-prefix}-horizontal .@{noUi-css-prefix}-tooltip { --webkit-transform: translate(-50%, 0); - transform: translate(-50%, 0); - left: 50%; - bottom: 120%; -} -.@{noUi-css-prefix}-vertical .@{noUi-css-prefix}-tooltip { --webkit-transform: translate(0, -50%); - transform: translate(0, -50%); - top: 50%; - right: 120%; -} - - - - -.ph-range-slider-v1-default-default { - padding: @space-lg 0; - .noUi-horizontal, - .noUi-vertical { - height: 6px; - .noUi-handle { - width: 20px; - height: 20px; - left: -17px; - top: -9px; - } - } - .noUi-vertical{ - width: 6px; - } - .noUi-target { - background: #d7d7d7; - border-radius: 10px; - border: 1px solid #d7d7d7; - box-shadow: none; - } - .noUi-connect { - background: #c3c4c4; - box-shadow: none; - } - .noUi-handle { - border-radius: 50%; - border: 1px solid #d4d7d7; - background-color: #e1e1e1; - cursor: default; - box-shadow: none; - &:after, - &:before{ - content: ''; - display: none; - } - } -} diff --git a/test/expected/strip-quoted-sting-match.less b/test/expected/strip-quoted-sting-match.less new file mode 100644 index 0000000..7284d60 --- /dev/null +++ b/test/expected/strip-quoted-sting-match.less @@ -0,0 +1,10 @@ +.@{var}-handle:after { + content: "Content At quoted String comments"; + content: ""; +} + + + +.@{var}-handle:after{ + content : "Content After quoted String comments" +} \ No newline at end of file diff --git a/test/fixtures/large.less b/test/fixtures/large.less deleted file mode 100644 index 1af7190..0000000 --- a/test/fixtures/large.less +++ /dev/null @@ -1,331 +0,0 @@ -@noUi-css-prefix: noUi; - - -/* Start for non editable less */ - -/* @import "nouislider.core.less"; - * Functional styling; - * These styles are required for noUiSlider to function. - * You don't need to change these rules to apply your design. - */ - - -.@{noUi-css-prefix}-target, -.@{noUi-css-prefix}-target * { --webkit-touch-callout: none; --webkit-tap-highlight-color: rgba(0,0,0,0); --webkit-user-select: none; --ms-touch-action: none; - touch-action: none; --ms-user-select: none; --moz-user-select: none; - user-select: none; --moz-box-sizing: border-box; - box-sizing: border-box; -} -.@{noUi-css-prefix}-target { - position: relative; - direction: ltr; -} -.@{noUi-css-prefix}-base { - width: 100%; - height: 100%; - position: relative; - z-index: 1; /* Fix 401 */ -} -.@{noUi-css-prefix}-connect { - position: absolute; - right: 0; - top: 0; - left: 0; - bottom: 0; -} -.@{noUi-css-prefix}-origin { - position: absolute; - height: 0; - width: 0; -} -.@{noUi-css-prefix}-handle { - position: relative; - z-index: 1; -} -.@{noUi-css-prefix}-state-tap .@{noUi-css-prefix}-connect, -.@{noUi-css-prefix}-state-tap .@{noUi-css-prefix}-origin { --webkit-transition: top 0.3s, right 0.3s, bottom 0.3s, left 0.3s; - transition: top 0.3s, right 0.3s, bottom 0.3s, left 0.3s; -} -.@{noUi-css-prefix}-state-drag * { - cursor: inherit !important; -} - -/* Painting and performance; - * Browsers can paint handles in their own layer. - */ -.@{noUi-css-prefix}-base, -.@{noUi-css-prefix}-handle { - -webkit-transform: translate3d(0,0,0); - transform: translate3d(0,0,0); -} - -/* Slider size and handle placement; - */ -.@{noUi-css-prefix}-horizontal { - height: 18px; -} -.@{noUi-css-prefix}-horizontal .@{noUi-css-prefix}-handle { - width: 34px; - height: 28px; - left: -17px; - top: -6px; -} -.@{noUi-css-prefix}-vertical { - width: 18px; -} -.@{noUi-css-prefix}-vertical .@{noUi-css-prefix}-handle { - width: 28px; - height: 34px; - left: -6px; - top: -17px; -} - -/* Styling; - */ -.@{noUi-css-prefix}-target { - background: #FAFAFA; - border-radius: 4px; - border: 1px solid #D3D3D3; - box-shadow: inset 0 1px 1px #F0F0F0, 0 3px 6px -5px #BBB; -} -.@{noUi-css-prefix}-connect { - background: #3FB8AF; - box-shadow: inset 0 0 3px rgba(51,51,51,0.45); --webkit-transition: background 450ms; - transition: background 450ms; -} - -/* Handles and cursors; - */ -.@{noUi-css-prefix}-draggable { - cursor: ew-resize; -} -.@{noUi-css-prefix}-vertical .@{noUi-css-prefix}-draggable { - cursor: ns-resize; -} -.@{noUi-css-prefix}-handle { - border: 1px solid #D9D9D9; - border-radius: 3px; - background: #FFF; - cursor: default; - box-shadow: inset 0 0 1px #FFF, - inset 0 1px 7px #EBEBEB, - 0 3px 6px -3px #BBB; -} -.@{noUi-css-prefix}-active { - box-shadow: inset 0 0 1px #FFF, - inset 0 1px 7px #DDD, - 0 3px 6px -3px #BBB; -} - -/* Handle stripes; - */ -.@{noUi-css-prefix}-handle:before, -.@{noUi-css-prefix}-handle:after { - content: ""; - display: block; - position: absolute; - height: 14px; - width: 1px; - background: #E8E7E6; - left: 14px; - top: 6px; -} -.@{noUi-css-prefix}-handle:after { - left: 17px; -} -.@{noUi-css-prefix}-vertical .@{noUi-css-prefix}-handle:before, -.@{noUi-css-prefix}-vertical .@{noUi-css-prefix}-handle:after { - width: 14px; - height: 1px; - left: 6px; - top: 14px; -} -.@{noUi-css-prefix}-vertical .@{noUi-css-prefix}-handle:after { - top: 17px; -} - -/* Disabled state; - */ - -[disabled] .@{noUi-css-prefix}-connect { - background: #B8B8B8; -} -[disabled].@{noUi-css-prefix}-target, -[disabled].@{noUi-css-prefix}-handle, -[disabled] .@{noUi-css-prefix}-handle { - cursor: not-allowed; -} - -/*@import "nouislider.pips.less";*/ - - -/* Base; - * - */ -.@{noUi-css-prefix}-pips, -.@{noUi-css-prefix}-pips * { --moz-box-sizing: border-box; - box-sizing: border-box; -} -.@{noUi-css-prefix}-pips { - position: absolute; - color: #999; -} - -/* Values; - * - */ -.@{noUi-css-prefix}-value { - position: absolute; - text-align: center; -} -.@{noUi-css-prefix}-value-sub { - color: #ccc; - font-size: 10px; -} - -/* Markings; - * - */ -.@{noUi-css-prefix}-marker { - position: absolute; - background: #CCC; -} -.@{noUi-css-prefix}-marker-sub { - background: #AAA; -} -.@{noUi-css-prefix}-marker-large { - background: #AAA; -} - -/* Horizontal layout; - * - */ -.@{noUi-css-prefix}-pips-horizontal { - padding: 10px 0; - height: 80px; - top: 100%; - left: 0; - width: 100%; -} -.@{noUi-css-prefix}-value-horizontal { - -webkit-transform: translate3d(-50%,50%,0); - transform: translate3d(-50%,50%,0); -} - -.@{noUi-css-prefix}-marker-horizontal.@{noUi-css-prefix}-marker { - margin-left: -1px; - width: 2px; - height: 5px; -} -.@{noUi-css-prefix}-marker-horizontal.@{noUi-css-prefix}-marker-sub { - height: 10px; -} -.@{noUi-css-prefix}-marker-horizontal.@{noUi-css-prefix}-marker-large { - height: 15px; -} - -/* Vertical layout; - * - */ -.@{noUi-css-prefix}-pips-vertical { - padding: 0 10px; - height: 100%; - top: 0; - left: 100%; -} -.@{noUi-css-prefix}-value-vertical { - -webkit-transform: translate3d(0,50%,0); - transform: translate3d(0,50%,0); - padding-left: 25px; -} - -.@{noUi-css-prefix}-marker-vertical.@{noUi-css-prefix}-marker { - width: 5px; - height: 2px; - margin-top: -1px; -} -.@{noUi-css-prefix}-marker-vertical.@{noUi-css-prefix}-marker-sub { - width: 10px; -} -.@{noUi-css-prefix}-marker-vertical.@{noUi-css-prefix}-marker-large { - width: 15px; -} - -/* @import "nouislider.tooltips.less"; */ - -.@{noUi-css-prefix}-tooltip { - display: block; - position: absolute; - border: 1px solid #D9D9D9; - border-radius: 3px; - background: #fff; - color: #000; - padding: 5px; - text-align: center; -} -.@{noUi-css-prefix}-horizontal .@{noUi-css-prefix}-tooltip { --webkit-transform: translate(-50%, 0); - transform: translate(-50%, 0); - left: 50%; - bottom: 120%; -} -.@{noUi-css-prefix}-vertical .@{noUi-css-prefix}-tooltip { --webkit-transform: translate(0, -50%); - transform: translate(0, -50%); - top: 50%; - right: 120%; -} - - -/* END for non editable less */ - -/* If want Remove below css and wirte new */ - -.ph-range-slider-v1-default-default { - padding: @space-lg 0; - .noUi-horizontal, - .noUi-vertical { - height: 6px; - .noUi-handle { - width: 20px; - height: 20px; - left: -17px; - top: -9px; - } - } - .noUi-vertical{ - width: 6px; - } - .noUi-target { - background: #d7d7d7; - border-radius: 10px; - border: 1px solid #d7d7d7; - box-shadow: none; - } - .noUi-connect { - background: #c3c4c4; - box-shadow: none; - } - .noUi-handle { - border-radius: 50%; - border: 1px solid #d4d7d7; - background-color: #e1e1e1; - cursor: default; - box-shadow: none; - &:after, - &:before{ - content: ''; - display: none; - } - } -} diff --git a/test/fixtures/quoted-sting-match.less b/test/fixtures/quoted-sting-match.less new file mode 100644 index 0000000..d323d20 --- /dev/null +++ b/test/fixtures/quoted-sting-match.less @@ -0,0 +1,12 @@ +.@{var}-handle:after { + content: "Content At quoted String comments"; + content: ""; +} + +/* Comments without Quoted String; + */ +/*@import "Comments with Quoted String";*/ + +.@{var}-handle:after{ + content : "Content After quoted String comments" +} \ No newline at end of file From 5427a2dc3806bd3e355375652c4ea1f7d8a96776 Mon Sep 17 00:00:00 2001 From: "murthy.pattisapu" Date: Wed, 5 Feb 2020 17:00:54 +0530 Subject: [PATCH 5/6] Modfying less testcase to exact scenario - Empty qoutes are causing the issue in removing comments --- test/expected/strip-quoted-sting-match.less | 1 - 1 file changed, 1 deletion(-) diff --git a/test/expected/strip-quoted-sting-match.less b/test/expected/strip-quoted-sting-match.less index 7284d60..a23f9c9 100644 --- a/test/expected/strip-quoted-sting-match.less +++ b/test/expected/strip-quoted-sting-match.less @@ -4,7 +4,6 @@ } - .@{var}-handle:after{ content : "Content After quoted String comments" } \ No newline at end of file From cce0ec991784f815fbf070d2db971b90a869becd Mon Sep 17 00:00:00 2001 From: "murthy.pattisapu" Date: Wed, 5 Feb 2020 17:08:03 +0530 Subject: [PATCH 6/6] Modfying less testcase to exact scenario - Empty qoutes are causing the issue in removing comments --- test/expected/strip-quoted-sting-match.less | 9 +++++++++ test/fixtures/quoted-sting-match.less | 12 ++++++++++++ 2 files changed, 21 insertions(+) diff --git a/test/expected/strip-quoted-sting-match.less b/test/expected/strip-quoted-sting-match.less index a23f9c9..3c7d534 100644 --- a/test/expected/strip-quoted-sting-match.less +++ b/test/expected/strip-quoted-sting-match.less @@ -4,6 +4,15 @@ } +.@{var}-handle:after{ + content : "Content After quoted String comments" +} + +.@{var}-handle:after { + content: "Content At quoted String comments"; +} + + .@{var}-handle:after{ content : "Content After quoted String comments" } \ No newline at end of file diff --git a/test/fixtures/quoted-sting-match.less b/test/fixtures/quoted-sting-match.less index d323d20..0d42cdc 100644 --- a/test/fixtures/quoted-sting-match.less +++ b/test/fixtures/quoted-sting-match.less @@ -7,6 +7,18 @@ */ /*@import "Comments with Quoted String";*/ +.@{var}-handle:after{ + content : "Content After quoted String comments" +} + +.@{var}-handle:after { + content: "Content At quoted String comments"; +} + +/* Comments without Quoted String; + */ +/*@import "Comments with Quoted String";*/ + .@{var}-handle:after{ content : "Content After quoted String comments" } \ No newline at end of file