DenVdmj / htmlcompressor

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

htmlcompressor doesn't like <script> in commented out <!-- --> blocks #3

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
Compress the following html:

<!--<option value='same'><script
type="text/javascript">document.write('hi');</script>-->

What is the expected output? What do you see instead?
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
        at
java.lang.AbstractStringBuilder.replace(AbstractStringBuilder.java:79     
         7)
        at java.lang.StringBuilder.replace(StringBuilder.java:271)
        at
com.googlecode.htmlcompressor.compressor.HtmlCompressor.returnBlocks(     
         HtmlCompressor.java:172)
        at
com.googlecode.htmlcompressor.compressor.HtmlCompressor.compress(Html     
         Compressor.java:107)
        at cmdlinehtml.main(cmdlinehtml.java:40)

htmlcompressor.0.7.1 windows

Original issue reported on code.google.com by joesiegr...@gmail.com on 29 Sep 2009 at 10:50

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Fixed in 0.7.2 release.
Had to rethink a block preserving algorithm but as a result performance also 
slightly
improved.

Thanks.

Original comment by serg472@gmail.com on 1 Oct 2009 at 3:24