CKEditor - 如何禁用 PasteFromWord

发布于 2024-12-19 10:01:17 字数 105 浏览 2 评论 0原文

这简直要了我的命。我一小时都找不到解决方案。问题是 - 如何在 CKEditor 中完全禁用 PasteFromWord?我希望粘贴的文本是纯文本 - 根本不进行编辑。

提前致谢。

This one is killing me. I have not been able to find the solution for one hour. The question is - how do I completely disable pastefromword in CKEditor? I want the pasted text to be plain - not edited at all.

Thanks in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

幸福不弃 2024-12-26 10:01:17

在 ckeditor/config.js 中,使用:

config.forcePasteAsPlainText = true;

有关更多详细信息:http://docs。 cksource.com/ckeditor_api/symbols/CKEDITOR.config.html

In ckeditor/config.js, use:

config.forcePasteAsPlainText = true;

For more details: http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html

饮惑 2024-12-26 10:01:17

选择文件 CKEditor\CKEditor.js

查找关键字“i.toolbar_Full

操作以下代码块以添加、禁用或更改图标位置

i.toolbar_Full=[['Source','-','Save','NewPage','Preview','-','Templates'],['Cut','Copy','Paste','PasteText','PasteFromWord','-','Print','SpellChecker','Scayt'],['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],['Form','Checkbox','Radio','TextField','Textarea','Select','Button','ImageButton','HiddenField'],'/',['Bold','Italic','Underline','Strike','-','Subscript','Superscript'],['NumberedList','BulletedList','-','Outdent','Indent','Blockquote','CreateDiv'],['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],['BidiLtr','BidiRtl'],['Link','Unlink','Anchor'],['Flash','Table','HorizontalRule','Smiley','SpecialChar','PageBreak','Iframe'],'/',['Styles','Format','Font','FontSize'],['TextColor','BGColor'],['Maximize','ShowBlocks','-','About']];

choose the file CKEditor\CKEditor.js

look for keyword "i.toolbar_Full"

manipulate the following chunk of code to add, disable or change location of icons

i.toolbar_Full=[['Source','-','Save','NewPage','Preview','-','Templates'],['Cut','Copy','Paste','PasteText','PasteFromWord','-','Print','SpellChecker','Scayt'],['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],['Form','Checkbox','Radio','TextField','Textarea','Select','Button','ImageButton','HiddenField'],'/',['Bold','Italic','Underline','Strike','-','Subscript','Superscript'],['NumberedList','BulletedList','-','Outdent','Indent','Blockquote','CreateDiv'],['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],['BidiLtr','BidiRtl'],['Link','Unlink','Anchor'],['Flash','Table','HorizontalRule','Smiley','SpecialChar','PageBreak','Iframe'],'/',['Styles','Format','Font','FontSize'],['TextColor','BGColor'],['Maximize','ShowBlocks','-','About']];
转角预定愛 2024-12-26 10:01:17

尝试使用此代码(config.js)

config.removePlugins = 'PasteFromWord';

它可能对您有帮助......

Try with this code (config.js)

config.removePlugins = 'PasteFromWord';

it may be helpful to You...

夜唯美灬不弃 2024-12-26 10:01:17

好了...将该行

config.removeButtons = 'PasteFromWord';

代码添加到底部的 config.js 文件中。

there ya go...

config.removeButtons = 'PasteFromWord';

add that line of code to your config.js file at the bottom..

秋千易 2024-12-26 10:01:17

在 config.js 文件中使用以下行:

config.pasteFromWord=true;
config.pasteFromWordRemoveFontStyles = true;
config.pasteFromWordNumberedHeadingToList =true;

Use these lines in your config.js file :

config.pasteFromWord=true;
config.pasteFromWordRemoveFontStyles = true;
config.pasteFromWordNumberedHeadingToList =true;
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文