Handle CSS-comments correctly in the preprocess-function (PR 14886 follow-up)

I overlooked this in PR 14886, sorry about that!
This commit is contained in:
Jonas Jenwald 2022-05-28 08:41:25 +02:00
parent e6a0a953e8
commit 65fe0130f4
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*/