@@ -1,5 +1,9 @@
11 // by @xonecas based on https://github.com/tylerhall/html-compressor.git
22 module.exports = function (source, noComments) {
3+ if (noComments) { // remove comments
4+ source = source.replace(/<\!--.*?--\>/g, "");
5+ }
6+
37 var lines = source.split("\n"),
48 insidePre = false, kompressed = "";
59
@@ -34,10 +38,6 @@ module.exports = function (source, noComments) {
3438 kompressed += (insidePre)? line+"\n": line;
3539 } // end while
3640
37- if (noComments) { // remove comments
38- kompressed = kompressed.replace(/<\!--.*?--\>/g, "");
39- }
40-
4141 return kompressed;
4242 }
4343