I'm new to using JTidy and found it to be a great tool however I have just encountered a problem with a particular html error which it doesn't deal with. I found the particular senario on http://whatsmyuseragent.com/ where a conditional comment is wrapped around another comment like this.
This mean's that technically the closing </style> is uncommented and the <![endif]--> is misplaced because the close of the inner comment actually closes the outer comment too.
When JTidy encounters this it warns about the misplaced closing style tag as you would expect.
"line 56 column -3 - Warning: discarding unexpected </style>"
However the resulting dom is empty after the commented style tag apart from an empty body tag ... the outputted html is like this:
[ .... top of document ... ]