ckeditor strips <span> and style attributes

james picture james · Aug 21, 2013 · Viewed 22.7k times · Source

I have a Drupal 7 site using ckeditor 4.2. I've created a basic page node and put a span inside an h2 heading in the body. I hard coded it in the html view. It looks fine but if I go back to edit the page, my has gotten stipped out of the html and also any style="" I've put into the html also. I've looked at the ckeditor config and text-formats. I've set the only formats allowed to be text and full html so I'm not using filtered at all. What gives? I've used the editor many times before but probably not this version.

Answer

TheodorosPloumis picture TheodorosPloumis · Aug 22, 2013

If you are using the CKeditor module then there is an option in Advanced Options that is also mentioned in the module homepage where you should set:

config.allowedContent = true;

CKeditor configuration