CKEditor removing inline styling and other attributes when view Source

If you have questions about using mojoPortal, you can post them here.

You may want to first review our site administration documentation to see if your question is answered there.

This thread is closed to new posts. You must sign in to post in the forums.
8/30/2013 12:17:45 PM
Gravatar
Total Posts 537
feet planted firmly on the ground

CKEditor removing inline styling and other attributes when view Source

I've upgraded a site to Version2.3.9.8 MSSQL, (Operating SystemMicrosoft Windows NT 6.0.6002 Service Pack 2

ASP.NET Infov4.0.30319 Running in Full Trust) and we have noticed that CKEditor is removing attributes from HTML Content.

For example, if we switch to "source" view, and add styling to a div like this:

<div  style="background-color: red; float:right;">some stuff</div> 

then save the edits, the styling shows fine in the browser. But when we click "edit" and go back to the "source" the attribute has gone.

I wondered if this was CKEditor being fierce about not using inline styling, but the same happens if we add  <div class="modulecontent">. It does not strip attributes from all elements - this survives for example: <img alt="Mike" src="/Data/Sites/1/media/about/Mike.jpg" style="height:187px; width:187px" />

I've tested on demo.mojoportal.com and cannot replicate this. 

With a little more investigation with Fiddler, I can see that the attribute is still there when we first click "edit", for example I can see this in the response from  /HtmlEdit.aspx?mid=...

&lt;div  style=&quot;background-color: red; float:right;&quot;&gt;some stuff&lt;/div&gt; 

But when we click on "Source" it is stripped and this turns into

<div>some stuff</div>

We are using a custom config file for CKEditor, but the config is similar to the default one except for changing the language to en-GB and switching off scayt.

Any ideas?

8/30/2013 12:25:36 PM
Gravatar
Total Posts 18439

Re: CKEditor removing inline styling and other attributes when view Source

See this thread for the solution

8/30/2013 1:25:40 PM
Gravatar
Total Posts 537
feet planted firmly on the ground

Re: CKEditor removing inline styling and other attributes when view Source

Thanks Joe, that fixed it.

You must sign in to post in the forums. This thread is closed to new posts.