CKEditor tweaks my code... how to solve?

Mar 11, 2010 at 4:42 AM

After switching to CKEditor 1.7 for DNN, I noticed the code being tweaked and broken.

I'm assuming, in this specific case, it's because I have an empty <a></a> tag. It may be invalid initially, but by the time it's loaded in the DOM (when the script runs) it would be valid.

I know you're not the programmer behind CKEditor, just the excellent implementation for DNN, but maybe you can turn me on to some resources to see if there are configurations or something else to prevent this from breaking.

Here's the code before it gets broken:

 

<script src="/static/flowplayer-3.1.4.min.js"></script>
<a shape="rect" style="width: 335px; display: block; height: 251px;" id="player" href="/ARWebinar2.mp4"></a>
<script language="JavaScript"> flowplayer("player", "/static/flowplayer-3.1.4.swf", {clip: {autoPlay: true,autoBuffering:true,scaling: 'orig'},plugins: { controls: {autoHide: 'always'} },}); </script>

 

Here's the code after CKEditor loads it:

 

<script src="/static/flowplayer-3.1.4.min.js"></script>
<p>
	<script language="JavaScript"> flowplayer("player", "/static/flowplayer-3.1.4.swf", {clip: {autoPlay: true,autoBuffering:true,scaling: 'orig'},plugins: { controls: {autoHide: 'always'} },}); 
</script>
</p>

 

 

 

 

Mar 11, 2010 at 10:45 AM
Edited Mar 11, 2010 at 10:46 AM

The CKEditor developers call that a Feature, the link tag gets removed because it didn't have a link text, and thats not valid W3c code. The only workaround i  find is adding the name Attribute to the tag

<script src="/static/flowplayer-3.1.4.min.js"></script>  
<a shape="rect" style="width: 335px; display: block; height: 251px;" id="player" name="player" href="/ARWebinar2.mp4"></a>
<
script language="JavaScript"> flowplayer("player", "/static/flowplayer-3.1.4.swf",
{clip: {autoPlay: true,autoBuffering:true,scaling: 'orig'},plugins: { controls: {autoHide: 'always'} },});
</script>

 

then the Editor will accept the code.