File tree Expand file tree Collapse file tree 3 files changed +16
-2
lines changed Expand file tree Collapse file tree 3 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -375,6 +375,7 @@ Given:
375375// options.params.ENV === 'product'
376376
377377// #!if ENV === 'develop'
378+ /** some comment */
378379console .log (" many doge" );
379380// #!else
380381console .log (" much wow" );
@@ -385,6 +386,7 @@ If set to `true`, yields:
385386
386387``` javascript
387388// #!if ENV === 'develop'
389+ // /** some comment */
388390// console.log('many doge');
389391// #!else
390392console .log (" much wow" );
Original file line number Diff line number Diff line change @@ -44,6 +44,12 @@ export function print(
4444 lastCommentClose = c_close || lastCommentClose ;
4545
4646 segment = raw ;
47+ } else if ( isComment ) {
48+ // comment may contain multiple lines
49+ const lines = raw . split ( "\n" ) . filter ( ( l ) => l !== "" ) ;
50+ segment = lines
51+ . map ( ( l ) => verbosePrint ( lastCommentOpen , lastCommentClose , l ) )
52+ . join ( "" ) ;
4753 } else {
4854 segment = verbosePrint ( lastCommentOpen , lastCommentClose , raw ) ;
4955 }
Original file line number Diff line number Diff line change @@ -166,7 +166,10 @@ const a = 1;
166166/* #!debug */
167167const b = 2;
168168<!-- #!if foo === 1 -->
169- /* NOT ME */
169+ /*
170+ NOT ME
171+ */
172+ /* NOT ME EITHER */
170173const c = 3;
171174<!-- #!endif -->
172175` ;
@@ -177,7 +180,10 @@ module.exports.R_VERBOSE_MIXED = `
177180/* #!debug */
178181/* const b = 2;*/
179182<!-- #!if foo === 1 -->
180- /* NOT ME */
183+ <!-- /*-->
184+ <!-- NOT ME-->
185+ <!-- */-->
186+ <!-- /* NOT ME EITHER */-->
181187<!-- const c = 3;-->
182188<!-- #!endif -->
183189` ;
You can’t perform that action at this time.
0 commit comments