Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Stop CKEditor removing divs

I've installed CKEditor in the backend of my website. I've got the following problem when switching from code view to wysiwyg view. The code I'm inserting is like:

<div class="span4">
    <p>Some text here</p>
</div>

When I switch back to view mode CKEditor automatically removes the div surrounding the paragraph.

Can anyone please help me to remove this problem? I don't mind staying in code view but I do like working in the view mode for writing longer text.

Thanks in advance.

like image 801
xonorageous Avatar asked May 28 '13 19:05

xonorageous


2 Answers

var editor1=CKEDITOR.replace('editor1');
editor1.config.allowedContent = true;
like image 175
Sijo Thomas Maprayil Avatar answered Oct 19 '22 08:10

Sijo Thomas Maprayil


Like AlfonsoMl said, this has something to do with the Advanced Content Filter

For all support about this look here: http://docs.ckeditor.com/#!/guide/dev_advanced_content_filter

or put the following line in your config to disable the content filter. (It's better to configure it)

CKEDITOR.config.allowedContent = true;
like image 21
Spons Avatar answered Oct 19 '22 08:10

Spons