Handle CSS-comments better in the preprocess-function (PR 14963 follow-up)

This fixes another oversight, please see the updated tests.
This commit is contained in:
Jonas Jenwald 2022-06-02 15:41:22 +02:00
parent 1ac33c960d
commit 397f2e63d0
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)
) {
writeLine(
line.replace(/^\/\/|^\/\*|^<!--/g, " ").replace(/\*\/$|-->$/g, "")
line
.replace(/^\/\/|^<!--/g, " ")
.replace(/(^\s*)\/\*/g, "$1 ")
.replace(/\*\/$|-->$/g, "")
);
}
}

View File

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

View File

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