Merge pull request #14963 from Snuffleupagus/preprocessCSS-comments

Handle CSS-comments correctly in the `preprocess`-function (PR 14886 follow-up)
This commit is contained in:
Tim van der Meij 2022-05-29 13:22:22 +02:00 committed by GitHub
commit 3e67d97f81
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 1 deletions

View File

@ -208,7 +208,9 @@ function preprocess(inFilename, outFilename, defines) {
!stack.includes(STATE_IF_FALSE) &&
!stack.includes(STATE_ELSE_FALSE)
) {
writeLine(line.replace(/^\/\/|^<!--/g, " ").replace(/-->$/g, ""));
writeLine(
line.replace(/^\/\/|^\/\*|^<!--/g, " ").replace(/\*\/$|-->$/g, "")
);
}
}
}

View File

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

View File

@ -0,0 +1,6 @@
/* Comment here... */
/*#if TRUE*/
/*div {*/
/* margin: 0;*/
/*}*/
/*#endif*/