Greetings,

I have spent significant amount of time within CKEditor trying to find some option to stop it from stripping out classes from html tags. I know this problem is specific to CKEditor because if I disable the editor my classes are preserved without any problem. Is this happening to anybody else? How do I solve it? Thanks. Kevin

Comments

steven_kropp’s picture

Same problem here... I toggle source code, wrap my lists with

and give the
a class style:
is still there minus the class style.

Also I'm using "Full HTML" text format with the Limit allowed HTML tags un-checked.

I've always been able to do this before—now suddenly I cannot.

pyxio’s picture

Yes. weird thing is it removes the classes but keeps the div. so <div class="foo"> becomes simply <div>. I have searched high and low through config settings to find the culprit. nothing works. much to my chagrin i have to change editors because the classes it is wiping out are important for me.

steven_kropp’s picture

I found a work around here http://drupal.org/node/1980428 if you still wanted to use CKeditor.

pyxio’s picture

Thanks Steven!

Andrei.Sapeshko’s picture

Here is another possible solution.
http://drupal.org/node/2000712

pyxio’s picture

still not working 100%. it is improved by disabling advanced content filter. however, it still strips out classes. these are heavily used in bootstrap themes.

prabhatjn’s picture

sony.sanjay’s picture

Hi,

If the problem started happening when you updated CKEditor library to 4.1 then in the below suggestion will help you.

Please go to the CKEditor and please go to "Advanced options" section of CKEditor profile add this:

config.allowedContent = true;

Thanks
Sanjay

wotney’s picture

Thanks Sanjay, #8 did the trick for me

vokiel’s picture

Category: Bug report » Support request
Issue summary: View changes
Status: Active » Closed (works as designed)

Using config.allowedContent = true; allows all. Basically it disables ACF (Advanced Content Filter) at all, which is not desired and safe.

Better set the config.allowedContent, see more at https://ckeditor.com/docs/ckeditor4/latest/guide/dev_advanced_content_filter.html.