ctrl + V从MS Word中防止CKEditor在OSX Safari上添加标签

问题描述:

ckeditor4存在问题。当我CTRL + ÇCTRL + v从微软Word在Windows上,它会删除所有标签和源代码视图我可以看到,只有pbr标签(这正是我需要的) ,但是当被在Safari MacOSX上执行该粘贴,在源视图CKEditor的,我可以看到有添加了很多“垃圾” - 我的意思是ow标签:ctrl + V从MS Word中防止CKEditor在OSX Safari上添加标签

Pasting on MacOSX, Safari

当然forcePasteAsPlainText = true;

而问题是如何防止添加这些标签?

不幸的是这CMS将用于客户端,我不能说“第一次在记事本中粘贴..”或类似的东西:)只有在Mac上按Ctrl +çCTRL +V苹果浏览器。

请尝试使用最新的CKEditor 4.7.3。

我看到你的结果在旧的CKEditor中删除了pastefromword插件,但最新的一个似乎仍然正常工作,即使ACF已禁用,pastefromword插件也被删除。

在旧编辑器中摆脱这些额外标签的唯一方法是在您的设置中使用pastefromword插件。

+0

看到一些upvotes,所以也许它对别人有帮助,但不是在我的情况。 最近试过4.7.3 config.disallowedContent ='xml,o,w'; config.removeFormatTags ='xml,o,w,ins,kbd'; config.forcePasteAsPlainText = true; – Vit

+0

你能更新你的文章并显示你的编辑器配置吗? –

+0

当然! in config.js: CKEDITOR.editorConfig = function(config){ config.removeButtons ='Underline,Subscript,Superscript'; config.format_tags ='p; h1; h2; h3; pre'; config.removeDialogTabs ='image:advanced; link:advanced'; config.allowedContent = true; config.filebrowserImageUploadUrl ='/kcfinder/upload.php?type=images'; config.filebrowserImageBrowseUrl ='/kcfinder/browse.php?type=images'; config.disallowedContent ='xml,o,w'; config.removeFormatTags ='xml,o,w,ins,kbd'; config.forcePasteAsPlainText = true; }; – Vit