Search code examples
drupaldrupal-7ckeditorwysiwyg

Drupal 7: Saved class of <ol>-Element gets stripped away on display


I've created a Plugin on CKEditor inside of Drupal 7, which inserts the following HTML code:

<ol class="advenum"><li></li></ol>

This is to create a better styled ordered list.

However, in the Editor, everything works fine. The class is there, and even after save, the class is being saved in the database and if I edit the text again, it is still there - so far so good.

But now when I visit the page which has just been saved, the class is being stripped away. I don't know wether there is some kind of filter in drupal 7, however I think I did not activate anything.

The WYSIWYG Profile is "Rich Text" and I did not activate either simple source formatting or advanced content filtering. How can it be?

Thanks for help!


Solution

  • I just found out what was the case:

    I went at Administration > Configuration > Content Authoring > Text formats, where I configured "Rich Text":

    At the enabled WYSIWYG-Filter, I entered at "HTML elements and attributes" the string @[class], and below at "Rules for Class Names" I entered the class itself for it is the only class which has to work like this.