The TinyMCE valid_elements property allows valid_elements to define a whitelist of valid HTML elements and their attributes. You can only allow paragraphs and links:
tinyMCE.init({ valid_elements: 'p,a[href]' });
However, the style attribute is a problem. This is necessary for some things, such as alignment, but if you enable it, then it may contain all sorts of undesirable CSS rules. Is there a way to restrict its contents to allow certain rules, for example:
a[href|style=text-align,font-size,color]
Marcus downing
source share