htmlcompressor icon indicating copy to clipboard operation
htmlcompressor copied to clipboard

one-line comment

Open GoogleCodeExporter opened this issue 10 years ago • 1 comments

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 [email protected] on 6 May 2014 at 9:44

GoogleCodeExporter avatar Nov 27 '15 21:11 GoogleCodeExporter

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 [email protected] on 7 May 2015 at 10:46

GoogleCodeExporter avatar Nov 27 '15 21:11 GoogleCodeExporter