Details
-
Improvement
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
1.1.3
-
None
-
None
Description
It would be nice if the methods in DefaultAddResource$ParseCallbackListener had improved handling of unexpected HTML syntax. e.g. multiple body tags or multiple head tags.
Occaisionally these HTML tricks are used to work around browser bugs (e.g. http://www.htmlgoodies.com/beyond/reference/article.php/3472881); but in Tomahawk 1.1.3 multple HEAD tags break the character positioning of script and style resources (in DefaultAddResource#writeWithFullHeader) included as Tomahawk Extensions.
Note: Multiple HEAD tags used to work okay in Tomahawk 1.1.1; defaulting to the first HEAD tag. presumably the parsing has changed a little.
Example fix:
public void closedStartTag(int charIndex, int tagIdentifier)
{
if (tagIdentifier == ReducedHTMLParser.HEAD_TAG)
{
if (headerInsertPosition == -1)
else
{ log.warn("Bad HTML Syntax. Multiple HEAD tags detected; using first occurrance."); }
}
...
}