Export to GitHub

htmlcompressor - issue #94

one-line comment


Posted on May 6, 2014 by Quick Bear

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.

Comment #1

Posted on May 7, 2015 by Happy Cat

I am came across the same issue, anything after single comment completely ignored I guess

My script

if (!window.init) { window.init = function(){}; //Adding to fix problem with init undefined. }

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.

Status: New

Labels:
Type-Defect Priority-Medium