Menu

#11 <[CDATA[ ]]> added unnecessarily

2.13
open
nobody
None
5
2015-05-15
2009-08-20
Pat
No

<script src=....></script> would get transformed to <script src=...><[CDATA[]]></script> (as would an empty style element )

this is the change to XmlSerializer:

/\*\*
 \* encapsulate content with &lt;\[CDATA\[ \]\]&gt; for things like script and style elements
 \* @param tagNode
 \* @return true if &lt;\[CDATA\[ \]\]&gt; should be used.
 \*/
protected boolean dontEscape\(TagNode tagNode\) \{
    // make sure &lt;script src=..&gt;&lt;/script&gt; doesn't get turned into &lt;script src=..&gt;&lt;\[CDATA\[\]\]&gt;&lt;/script&gt;
    // TODO check for blank content as well.
    return props.isUseCdataForScriptAndStyle\(\) && isScriptOrStyle\(tagNode\) && \!tagNode.getChildren\(\).isEmpty\(\);
\}

I have a test too.. but don't want to spend the time on trying to create a partial patch

Discussion

  • Scott Wilson

    Scott Wilson - 2015-05-12
    • Group: --> 2.12
     
  • Scott Wilson

    Scott Wilson - 2015-05-15
    • Group: 2.12 --> 2.13
     

Log in to post a comment.