You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "David Turner (JIRA)" <de...@myfaces.apache.org> on 2007/02/15 02:08:05 UTC

[jira] Created: (TOMAHAWK-899) DefaultAddResource - Improve handling of bad HTML syntax

DefaultAddResource - Improve handling of bad HTML syntax
--------------------------------------------------------

                 Key: TOMAHAWK-899
                 URL: https://issues.apache.org/jira/browse/TOMAHAWK-899
             Project: MyFaces Tomahawk
          Issue Type: Improvement
    Affects Versions: 1.1.3
            Reporter: David Turner
            Priority: Minor
             Fix For: 1.1.3


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) {
                     headerInsertPosition = charIndex;
                } else {
                     log.warn("Bad HTML Syntax. Multiple HEAD tags detected; using first occurrance.");
                } 
            }
            ...
        }



-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.