且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

tinyMCE删除MS Word标签

更新时间:2023-12-03 21:27:04

我不确定您想要什么,但是我想您正在尝试将Word中的文本复制到tinymce中.为了摆脱所有不需要的标签和诸如textdecoration之类的其他东西,您需要使用粘贴 插件 .将此设置用于您的init函数:

I am not definetly sure what you want, but i guess you are trying to copy text from Word into tinymce. In order to get rid of all not wanted tags and other things like textdecoration you need to use the paste plugin. Use this settings for your init function:

plugins : "paste,...",
paste_use_dialog : false,
paste_auto_cleanup_on_paste : true,
paste_convert_headers_to_strong : false,
paste_strip_class_attributes : "all",
paste_remove_spans : true,
paste_remove_styles : true,
paste_retain_style_properties : "",

您还可以使用paste_preprocess和/或paste_postprocess设置对粘贴的代码执行javascript操作.

You may also use paste_preprocess and/or paste_postprocess setting to perform javascript action on the pasted code.