问题
I am trying to configure tinymce to not allow css styles in style attribute.
I just want to allow one style which is text-decoration. Here is a similar problem http://tinymce.moxiecode.com/punbb/viewtopic.php?pid=76101 .
The valid_styles option is not present and I dont want to use regexp on my content, coz there got to be some or the other option with tinymce. I searched through the tinymce forums but couldn't find any proper solution.
Can anybody help?
回答1:
What you need to do is tu use the paste plugin and do some prefiltering when performing copy+paste into the editor.
Use the paste_preprocess setting in your init, using your own cleanup mechanism here:
paste_preprocess : function(pl, o) {
o.content = custom_function_modify(o.content);
},
来源:https://stackoverflow.com/questions/3677502/tinymce-remove-css-styles-from-style-attribute