Skip to content

Commit

Permalink
Don't remove the conditional comment for IE
Browse files Browse the repository at this point in the history
  • Loading branch information
abarre committed Jul 18, 2012
1 parent 47a1f5a commit a6c4e0f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/kompressor.js
Expand Up @@ -5,7 +5,7 @@ var excludedTags = 'pre|script|style'
// by @xonecas based on https://github.com/tylerhall/html-compressor.git
module.exports = function (source, noComments) {
if (noComments) { // remove comments
source = source.replace(/<\!--.*?--\>/g, "");
source = source.replace(/<\!--(:!if).*?--\>/g, "");
}

var lines = source.split("\n"),
Expand Down

2 comments on commit a6c4e0f

@stefounet
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This new regex broke the remove comments feature.
Even standard HTML comments are not removed when applying this new regex.
This should be : //g (begin comment - allow whitespaces - everything except something beginning with [ - end comment)

@abarre
Copy link
Member Author

@abarre abarre commented on a6c4e0f Sep 6, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.