Skip to content

Commit

Permalink
Handle CSS-comments better in the preprocess-function (PR 14963 follo…
Browse files Browse the repository at this point in the history
…w-up)

This fixes another oversight, please see the updated tests.
  • Loading branch information
Snuffleupagus committed Jun 2, 2022
1 parent 1ac33c9 commit 397f2e6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
5 changes: 4 additions & 1 deletion external/builder/builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -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, "")
);
}
}
Expand Down
1 change: 1 addition & 0 deletions external/builder/fixtures/css-comment-expected.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* Comment here... */
div {
margin: 0;
padding: 0;
}
1 change: 1 addition & 0 deletions external/builder/fixtures/css-comment.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
/*#if TRUE*/
/*div {*/
/* margin: 0;*/
/*padding: 0;*/
/*}*/
/*#endif*/

0 comments on commit 397f2e6

Please sign in to comment.