The following HTML document should be given an empty body element (I'm using square brackets instead of angled brackets, just to make sure it doesn't get mangled):
[html]
[head]
[title]Test[/title]
[/head]
[/html]
I believe a body element is already inserted correctly if there's trailing content between the end of the head section and the end of the html. However, the case where there is no content between the end of the head section and the end of the html is not being handled correctly.
Logged In: YES
user_id=2018412
Originator: NO
HTMLParser.addBodyToPageIfNecessary is a private method which is never called. It seems to me as if though it can simply be deleted.
Logged In: YES
user_id=402164
Originator: NO
HTMLParser.addBodyToPageIfNecessary concerns HtmlUnit, not NekoHTML, and it is called!
Nervertheless, this is correct, NekoHTML should add <head> and <body> automatically when missing.
Now fixed in SVN. In fact both HEAD and BODY should be added if missing.