[Bug 3298] Validator incorrectly interprets HTML fragments in a JavaScript string as misplaced elements

http://www.w3.org/Bugs/Public/show_bug.cgi?id=3298

           Summary: Validator incorrectly interprets HTML fragments in a
                    JavaScript string as misplaced elements
           Product: Validator
           Version: HEAD
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: check
        AssignedTo: link@pobox.com
        ReportedBy: asluka@htinc.com
         QAContact: www-validator-cvs@w3.org


One of our web applications uses an array of strings containing anchor tags for
dynamically building out a menu system, like this:

menu1[0] = '<a href="http://someurl.com/there">Some URL</a>';

This is inside a valid <script type="text/javascript"> tag, but the validator
complains with the following:

document type does not allow element "a" here.

The DOCTYPE is XHTML 1.0 Transitional:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

The rest of the page validates just fine.

Received on Friday, 19 May 2006 15:41:49 UTC