Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#239 Html error with comment results in almost empty dom

open
nobody
5
2012-10-08
2010-10-28
Andrew Murdoch
No

Hi,

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.

</style>
<![endif]-->

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 ... ]

</head><body/></html>

Discussion

  • Andrew Murdoch
    Andrew Murdoch
    2010-10-29

    For the record I just tried this same html file out in HTML Tidy and it produced the same result so I will post this bug there also.