[Bug 13998] New: Incorrectly throwing "marked section end not in marked section declaration" while parsing legitimate Javascript

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

           Summary: Incorrectly throwing "marked section end not in marked
                    section declaration" while parsing legitimate
                    Javascript
           Product: Validator
           Version: HEAD
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Parser
        AssignedTo: dave.null@w3.org
        ReportedBy: ti.42.plus@gmail.com
         QAContact: www-validator-cvs@w3.org


This bug appeared just a few days ago.

I'm not entirely sure why this happens, but it seems to be the lines

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript';
ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' :
'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(ga, s);
  })();

that throw off parsing somehow, because once I remove it, the error is gone.
Yet it seems to be well-formed Javascript, and when I put it in a <script> tag
alone, without any other scripts surrounding it, the error doesn't show up. (In
case you're wondering, this code is from Google Analytics.)

The page where the bug appeared was on http://free.clrhome.tk/
(http://validator.w3.org/check?uri=http%3A%2F%2Ffree.clrhome.tk%2F for the
actual validation page). It's checking the page as XHTML 1.0 Strict with
encoding UTF-8, and it's throwing the error on the // ]]> that ends a CDATA
section in a <script> element.

-- 
Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

Received on Thursday, 1 September 2011 16:58:41 UTC