Closed iamcarrico closed 9 years ago
Note: failure is from whitespace I believe— not sure how to create the same whitespace after playing with it for a while.
You're right, this needs fixing. Another PR has it passing Travis? https://github.com/paolochiodi/htmlcompressor/pull/33
Fixed the issue— #33 and this to similar things. #33 just comments it out, I remove it entirely. Up to the maintainer which one is more desirable for the project.
Hi, sorry for taking so long to act on this. I decide to go with the other PR on the same issue, because we are using CDATA only if it's already present in the original code. It would be unexpected to remove that in the minified version. It's also maintains the same level of compatibility with browsers.
When we add JavaScript into rails, it automatically adds in the
//<![CDATA[
wrappers around the JavaScript. When we run the compressor with this:It outputs this:
which causes the function not to run. yui will removes the CDATA.
This PR just removes the code that will re-add in a CDATA around the code. If we feel it is necessary to put it back in, I suggest adding a comment wrapper around them and making it optional.