CKEditor extraAllowedContent with a Twist

Jun 9, 2015. | By: Mike

Ever wanted to have fun with CKEditor? Well, let’s see.

We wanted to allow CKEditor to have an in-line stylesheet for a specific class while enabling the Advanced Content Filter. This turns out pretty tricky because of the spotty CKEditor documentation and we thought we’d share. Here is a simple one liner that can solve your headache.

config.extraAllowedContent = 'a(!simple-button-plugin){*}[*]';

This will have the following effect:

  • a - Element you want to keep the in-line style.
  • !simple-button-plugin - The simple-button-plugin is a class name and ! forces the button to be matched.
  • {*} - Allows all style properties be allowed.
  • [*] - Allows all attributes be allowed.

Subscribe

Subscribe to this blog via RSS.

Recent Posts

About

BLEN Corp is a small, minority, and veteran-owned information technology firm located in Washington D.C. Since 2004, we have been ahead of the curve in early adaption and implementation of cutting edge technologies including web and mobile development, service-oriented architecture, and other innovative web based solutions. Look at some of our projects.

Social Links

Our Bunker

WeWork Wonder Bread Factory
641 S St. NW
3rd Floor
Washington, DC 20001
United States.