Skip to content
This repository has been archived by the owner on Apr 21, 2023. It is now read-only.

Preserve CDATA tags on scripts in XHTML #309

GoogleCodeExporter opened this issue Apr 6, 2015 · 3 comments

Preserve CDATA tags on scripts in XHTML #309

GoogleCodeExporter opened this issue Apr 6, 2015 · 3 comments


Copy link

What steps will reproduce the problem?
1. Install Mint (
2. View Mint stats

What is the expected output? What do you see instead?
Each Mint stats panel (page views by day, recent referrer, most popular pages, 
etc.) should make an asynchronous Ajax query and return (and display) those 
statistics. Instead, the page loads and those panels are never populated.

What version of the product are you using (please check X-Mod-Pagespeed header)?

On what operating system?
CentOS release 5.6

Which version of Apache?

Which MPM?

Please provide any additional information below, especially a URL or an HTML 
file that exhibits the problem.

Two files are attached—one the HTML returned by Mint with modpagespeed 
enabled (mint-broken.html) and one with it disabled (mint-works.html).

Submitted by request of Joshua Marantz 

Original issue reported on by on 19 Jun 2011 at 10:01


Copy link

Looks like we are transforming:

<script type="text/javascript" language="javascript">
// <![CDATA[
SI.Mint.collapse    = true;
window.onload   = function() { SI.Mint.staggerPaneLoading(true); 
SI.Mint.sizePanes(); SI.Mint.onloadScrolls(); };
window.onresize = function() { SI.Mint.sizePanes(); };
// ]]>


<script type="text/javascript" 

We have lost the 'CDATA' syntax, which I thought we were pretty careful to put 
in when we ineline scripts.  But evidently we are not retaining it when we 
rewrite scripts.

Original comment by on 20 Jun 2011 at 2:32

Copy link

The breakage appears to be due to the use of && in a script block in XHTML.  
Good StackOverflow summary here:

Basically, the script parser worries about different characters (< and & rather 
than </) when parsing a script in the absence of CDATA.  The CDATA puts the 
X[HT]ML parser into "just the characters you see, please" mode.

This is also an issue with scripts we choose to inline into html vs xhtml.

Original comment by on 20 Jun 2011 at 12:12

  • Changed title: Preserve CDATA tags on scripts in XHTML

Copy link

This is now fixed in trunk.

Original comment by on 15 Jul 2011 at 2:01

  • Changed state: Fixed

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet

No branches or pull requests

1 participant