Rodrigo-jf / htmlcompressor

Automatically exported from code.google.com/p/htmlcompressor
0 stars 0 forks source link

<script> in comments #68

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

Next piece of html is compressed incorrectly 
<!--<script type="text/javascript" src="..."/>-->
<script type="text/javascript">document.write('hello')</script><!--some more 
comment-->

What is the expected output? What do you see instead?
The compressed output is empty. but is should be 
<script type="text/javascript">document.write('hello')</script>

What version of the product are you using? On what operating system?
1.4

Please provide any additional information below.

Original issue reported on code.google.com by zona...@gmail.com on 30 Jan 2012 at 8:35

GoogleCodeExporter commented 9 years ago
<script type="text/javascript">
    if (!window.init) {
        window.init = function(){}; //Adding to fix problem with init undefined.
    }
</script>

With the above script I get following exception

[ERROR] HtmlCompressor: "missing } in compound statement" at line [1:133] 
during JavaScript compression:  window.editMode = false;    if (!window.init) { 
       window.init = function(){}; //Adding to fix problem with init undefined. 
   }
[ERROR] HtmlCompressor: "Compilation produced 1 syntax errors." at line [1:0] 
during JavaScript compression
Exception in thread "main" org.mozilla.javascript.EvaluatorException: 
Compilation produced 1 syntax errors.

Original comment by j2ee.sr...@gmail.com on 7 May 2015 at 10:42