Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

tinyMCE strips "class"-attribute, although its in extended_valid_elements

tinyMCE keeps stripping the class-attribute of my element, when clicking "remove formatting", although i've added it to the extended_valid_elements. look here:

...
extended_valid_elements : "p[class],figure[class],figcaption",
valid_children : "+p[figure]",
...

all gets stripped. do you have any idea?

thank you very much!

like image 248
philippdatz Avatar asked Nov 18 '25 22:11

philippdatz


1 Answers

Take a look at this: http://tinymce.moxiecode.com/wiki.php/Configuration:formats (see the "remove format"-section).

You'll have to edit tiny_mce.js .
Search for the code shown there and add the following to the removeformat-array:

{selector : 'p', attributes : ['style'], split : false, expand : false, deep : true}

It should prevent tinymce from removing the class-attribute from p-elements when using the remove-format-button.

like image 138
Dr.Molle Avatar answered Nov 20 '25 13:11

Dr.Molle



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!