From cb18dce10e09453ebe52a44fa4835a5c2a4e70f1 Mon Sep 17 00:00:00 2001 From: Juriy Zaytsev Date: Tue, 9 Mar 2010 09:21:16 -0500 Subject: [PATCH] Fix comments in scripts (forgot that "\s*$/, ''); + var reStartDelimiter = { + 'script': /^\s*\s*$/, ''); } function isOptionalTag(tag) { @@ -221,7 +225,7 @@ chars: function( text ) { if (currentTag === 'script' || currentTag === 'style') { if (options.removeCommentsFromCDATA) { - text = removeComments(text); + text = removeComments(text, currentTag); } if (options.removeCDATASectionsFromCDATA) { text = removeCDATASections(text); diff --git a/tests/index.html b/tests/index.html index 73ab051..28efcd6 100644 --- a/tests/index.html +++ b/tests/index.html @@ -114,20 +114,29 @@ equals(minify(input, { removeComments: true }), input); }); - test('remove comments from scripts/styles', function(){ + test('remove comments from scripts', function(){ input = '