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:
Jonas Jenwald 2022-06-02 16:52:48 +02:00 committed by GitHub
commit 1953967681
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 1 deletions

View File

@ -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, "")
); );
} }
} }

View File

@ -1,4 +1,5 @@
/* Comment here... */ /* Comment here... */
div { div {
margin: 0; margin: 0;
padding: 0;
} }

View File

@ -2,5 +2,6 @@
/*#if TRUE*/ /*#if TRUE*/
/*div {*/ /*div {*/
/* margin: 0;*/ /* margin: 0;*/
/*padding: 0;*/
/*}*/ /*}*/
/*#endif*/ /*#endif*/