Our writers love to use the Twitter embed codes in Tridion (2011 SP1) to publish little embedded tweets. For example, they use the following type of code from Twitter's site:
<blockquote class="twitter-tweet"><p>Creating a great shopping experience. SDL Fredhopper 7.5. Find out more: <a href="http://t.co/uhEiFZwqTE" title="http://ow.ly/lhiL2">ow.ly/lhiL2</a> <a href="https://twitter.com/search/%23ecommerce">#ecommerce</a></p>— SDL WCM Solutions (@sdltridion) <a href="https://twitter.com/sdltridion/status/337878397172740097">May 24, 2013</a></blockquote>
<script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>
To do this, they:
Switch to the Source Tab of the RTF field
Paste the code above
This works relatively well, EXCEPT when they later switch between Design and Source
Source STARTS by showing the code fine when you copy and paste
If you switch to Design, you will see the Twitter embed piece
If you switch back to source, the code changes (I think Tridion is validating it), and it becomes this:
<iframe id="twitter-widget-0" class="twitter-tweet twitter-tweet-rendered" scrolling="no" frameborder="0" allowtransparency="true" title="Embedded Tweet" width="500" height="186" name="twitter-widget-0"/> <script async="" src="//platform.twitter.com/widgets.js" charset="utf-8" type="text/javascript"> <![CDATA[]]> </script> <iframe id="rufous-sandbox" scrolling="no" frameborder="0" allowtransparency="true" name="rufous-sandbox"/>
The problem with this is that the content won't render properly anymore. It adds CDATA (which may or may not be the problem), and it also seems to execute some Twitter code that ends up with that iframe in there (see rufous-sandbox above)
What I'm wondering:
Is there a way to strip out the CDATA tags?
Is there a way to tell Tridion not to run that JavaScript code in there when it switches between design and source?