Merge pull request #14980 from Snuffleupagus/preprocessCSS-comments-2
Handle CSS-comments better in the preprocess-function (PR 14963 follow-up)
This commit is contained in:
		
						commit
						1953967681
					
				
							
								
								
									
										5
									
								
								external/builder/builder.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										5
									
								
								external/builder/builder.js
									
									
									
									
										vendored
									
									
								
							@ -209,7 +209,10 @@ function preprocess(inFilename, outFilename, defines) {
 | 
				
			|||||||
        !stack.includes(STATE_ELSE_FALSE)
 | 
					        !stack.includes(STATE_ELSE_FALSE)
 | 
				
			||||||
      ) {
 | 
					      ) {
 | 
				
			||||||
        writeLine(
 | 
					        writeLine(
 | 
				
			||||||
          line.replace(/^\/\/|^\/\*|^<!--/g, "  ").replace(/\*\/$|-->$/g, "")
 | 
					          line
 | 
				
			||||||
 | 
					            .replace(/^\/\/|^<!--/g, "  ")
 | 
				
			||||||
 | 
					            .replace(/(^\s*)\/\*/g, "$1  ")
 | 
				
			||||||
 | 
					            .replace(/\*\/$|-->$/g, "")
 | 
				
			||||||
        );
 | 
					        );
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
				
			|||||||
@ -1,4 +1,5 @@
 | 
				
			|||||||
/* Comment here... */
 | 
					/* Comment here... */
 | 
				
			||||||
  div {
 | 
					  div {
 | 
				
			||||||
    margin: 0;
 | 
					    margin: 0;
 | 
				
			||||||
 | 
					    padding: 0;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										1
									
								
								external/builder/fixtures/css-comment.css
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								external/builder/fixtures/css-comment.css
									
									
									
									
										vendored
									
									
								
							@ -2,5 +2,6 @@
 | 
				
			|||||||
/*#if TRUE*/
 | 
					/*#if TRUE*/
 | 
				
			||||||
/*div {*/
 | 
					/*div {*/
 | 
				
			||||||
/*  margin: 0;*/
 | 
					/*  margin: 0;*/
 | 
				
			||||||
 | 
					  /*padding: 0;*/
 | 
				
			||||||
/*}*/
 | 
					/*}*/
 | 
				
			||||||
/*#endif*/
 | 
					/*#endif*/
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user