New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preserve CDATA tags on scripts in XHTML #309

GoogleCodeExporter opened this Issue Apr 6, 2015 · 3 comments


None yet
1 participant

GoogleCodeExporter commented Apr 6, 2015

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



This comment has been minimized.

GoogleCodeExporter commented Apr 6, 2015

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


This comment has been minimized.

GoogleCodeExporter commented Apr 6, 2015

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

This comment has been minimized.

GoogleCodeExporter commented Apr 6, 2015

This is now fixed in trunk.

Original comment by on 15 Jul 2011 at 2:01

  • Changed state: Fixed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment