marconilanna / htmlcompressor

Automatically exported from code.google.com/p/htmlcompressor
Apache License 2.0
1 stars 0 forks source link

one-line comment #94

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. save the following code to test.php:
  <?php
      echo 'This is a test'; // This is a one-line c++ style comment
      echo 'next line';
  ?>
2. use htmlcompressor to minify this file

What is the expected output? What do you see instead?
Expected: <?php echo 'This is a test';echo 'next line'?>
Instead:  <?php echo 'This is a test'; // This is a one-line c++ style comment 
echo 'next line'; ?>

What version of the product are you using? On what operating system?
1.5.3, On Windows Win7

Please provide any additional information below.

Original issue reported on code.google.com by huhang...@gmail.com on 6 May 2014 at 9:44

GoogleCodeExporter commented 9 years ago
I am came across the same issue, anything after single comment completely 
ignored I guess

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

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:46