kangax / html-minifier

Javascript-based HTML compressor/minifier (with Node.js support)
http://kangax.github.io/html-minifier/
MIT License
4.94k stars 571 forks source link

Strange Parse error #663

Closed sameh0 closed 8 years ago

sameh0 commented 8 years ago

i don't know what's the problem with this file but whenever i try to run htmlmin on it , it throw Parse error like this

$ gulp
[16:14:18] Using gulpfile /Volumes/Other/gulpfile.js
[16:14:18] Starting 'HTML'...
[16:14:18] Starting 'minifyjs'...
[16:14:18] Starting 'minifycss'...
[16:14:18] Starting 'copyimages'...
[16:14:18] Starting 'expetions'...
[16:14:18] Finished 'expetions' after 125 μs
[16:14:18] Starting 'phpmailer'...
[16:14:18] Finished 'phpmailer' after 1.42 ms

events.js:154
     throw er; // Unhandled 'error' event
     ^
Error: Parse Error: <a href"#">Support Application</a> exa </br>exaa </br>
<span><b>in Hardware</b></span> </br>
wweq
</h3>
<h2>DDD</h2>
<h3>AAA</h3>

<h2>WWW</h2>
<h3>Q,?. </br>
Whether it's a review, complain or advice We love chatting .
</br>You can <a href="//example.com/contacts">contact us</a> here.
</h3>

<h2 style="text-align:center">Hav <span id="ask" onclick="popup_mail();">Ask</span></h2>
</div>
<script type="text/javascript">
var forl=2;
function popup_mail(){
 $("head").append(' <link rel="stylesheet" href="/coaa.css">');
$.ajax({
type: "GET",
url: "/form"+ forl,
success:function (data) {
$.getScript('/jquery.popup.js', function(){
 var popup = new $.Popup({});
popup.open(data, 'html');

$.getScript('/caca.js', function(){});

});
}
});

}
</script>

   at new HTMLParser (/Volumes/Other/node_modules/html-minifier/src/htmlparser.js:236:13)
   at minify (/Volumes/Other/node_modules/html-minifier/src/htmlminifier.js:861:3)
   at Object.exports.minify (/Volumes/Other/node_modules/html-minifier/src/htmlminifier.js:1216:10)
   at objectAssign.fileName (/Volumes/Other/node_modules/gulp-htmlmin/index.js:22:39)
   at module.exports (/Volumes/Other/node_modules/tryit/tryit.js:8:9)
   at minifyHtml (/Volumes/Other/node_modules/gulp-htmlmin/index.js:21:9)
   at Transform.htmlminTransform [as _transform] (/Volumes/Other/node_modules/gulp-htmlmin/index.js:51:7)
   at Transform._read (/Volumes/Other/node_modules/gulp-htmlmin/node_modules/readable-stream/lib/_stream_transform.js:159:10)
   at Transform._write (/Volumes/Other/node_modules/gulp-htmlmin/node_modules/readable-stream/lib/_stream_transform.js:147:83)
   at doWrite (/Volumes/Other/node_modules/gulp-htmlmin/node_modules/readable-stream/lib/_stream_writable.js:319:64)

any thoughts

sameh0 commented 8 years ago

this fixed it .

- href"#"
+ href="#"