tinymce : Remove css styles from style attribute

帅比萌擦擦* 提交于 2019-12-13 02:04:10

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!