tinyMCE删除MS Word标签 [英] tinyMCE Removing MS Word tags

查看:195
本文介绍了tinyMCE删除MS Word标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用tinymce版本:3.3.7,当我从tinymce中粘贴作为纯文本"时,仍然得到了mso标签.是否可以通过tinyMCE中的某些设置删除这些标记,还是我需要使用php剥离标记?

I am using tinymce Version: 3.3.7 and when I go to paste "as plain text" from tinymce, I still get mso tags. Is it possible to have these removed by some setting in tinyMCE or do I need to strip the tags with php?

推荐答案

我不确定您想要什么,但是我想您正在尝试将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.

这篇关于tinyMCE删除MS Word标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆