Guesser
Guesser

Reputation: 1857

Ckeditor allowedContent with rules

I am trying to use allowedContent in the main config file to allow the inclusion of the class attribute for divs when in source editor mode.

I have tried

config.allowedContent='div[class]';

And for some this has the effect of removing some but not all of the toolbar options and also does not allow the inclusion of the class attribute.

There are no errors found on the debug inspector.

If I do

config.allowedContent=true;

This works as expected but I don't want to allow all content.

The toolbar options left are, full screen, source and format. That is from a custom selection.

Upvotes: 0

Views: 379

Answers (2)

Guesser
Guesser

Reputation: 1857

config.extraAllowedContent='div(*)';

For whatever reason using this method works.

Upvotes: 0

Marek Lewandowski
Marek Lewandowski

Reputation: 3401

If you want to allow any class use the following: config.allowedContent='div(*)'.

More on that you'll find in CKEditor docs

Upvotes: 1

Related Questions