deanhume / html-minifier

A simple command line tool to minify your HTML, Razor views & Web Forms views
http://deanhume.github.io/html-minifier/
MIT License
134 stars 86 forks source link

JavaScript single-line comments begin with a double forward slash (//) #16

Closed mikilion closed 8 years ago

mikilion commented 9 years ago

The inline JavaScript code with single-line comments begin with a double forward slash (//) causes to comment the remainder of javascript code on minimized html file; e.g.:

<script>
    var a; // this is a comment
    a = 3;
</script>

Minified:

<script>var a; // this is a comment a = 3;</script>

deanhume commented 9 years ago

Hi @mikilion - thanks for submitting this. I will look into it!

DiomedesDominguez commented 9 years ago

The solution is pretty easy: just remove the comment and then minimize the code.

walterDurin commented 8 years ago

Still an issue if no space between the double slash and the comment ie. //this is a comment

deanhume commented 8 years ago

This has been fixed with the latest release of v1.5 :+1:

https://github.com/deanhume/html-minifier/releases/tag/v1.5