
htmlcompressor - issue #3
htmlcompressor doesn't like <script> in commented out <!-- --> blocks
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
Comment #1
Posted on Oct 1, 2009 by Grumpy HippoComment deleted
Comment #2
Posted on Oct 1, 2009 by Grumpy HippoFixed in 0.7.2 release. Had to rethink a block preserving algorithm but as a result performance also slightly improved.
Thanks.
Status: Fixed
Labels:
Type-Defect
Priority-Medium