This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 13998 - Incorrectly throwing "marked section end not in marked section declaration" while parsing legitimate Javascript
Summary: Incorrectly throwing "marked section end not in marked section declaration" w...
Status: RESOLVED WORKSFORME
Alias: None
Product: Validator
Classification: Unclassified
Component: Parser (show other bugs)
Version: HEAD
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: This bug has no owner yet - up for the taking
QA Contact: qa-dev tracking
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-01 16:58 UTC by Deep Thought
Modified: 2011-09-03 13:21 UTC (History)
0 users

See Also:


Attachments

Description Deep Thought 2011-09-01 16:58:34 UTC
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.
Comment 1 Ville Skyttä 2011-09-03 07:06:56 UTC
The reproducer document now validates without errors, so I assume its cause was found and fixed in the doc.
Comment 2 Deep Thought 2011-09-03 13:21:35 UTC
(In reply to comment #1)
> The reproducer document now validates without errors, so I assume its cause was
> found and fixed in the doc.

Sorry, I just realized -- it's a problem with a script inserted by my host, not with the Validator.