Uploaded image for project: 'MyFaces Tomahawk'
  1. MyFaces Tomahawk
  2. TOMAHAWK-899

DefaultAddResource - Improve handling of bad HTML syntax

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 1.1.3
    • None
    • ExtensionsFilter
    • 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)

      { headerInsertPosition = charIndex; }

      else

      { log.warn("Bad HTML Syntax. Multiple HEAD tags detected; using first occurrance."); }


      }
      ...
      }

      Attachments

        Activity

          People

            Unassigned Unassigned
            computabloke David Turner
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: