如何在 CKEditor 4 中启用浏览器拼写检查?

How to enable browser spell check in CKEditor 4?

提问人:Nate 提问时间:6/4/2013 更新时间:1/8/2020 访问量:7781

问:

据说 CKEditor 有内置的拼写检查,但我从未见过它的工作(甚至在他们的现场演示网站上也没有),所以在 CKEditor 3 中,我在配置函数中添加了以下内容以启用浏览器拼写检查并启用浏览器上下文菜单:

config.disableNativeSpellChecker = false;
config.removePlugins = 'scayt,menubutton,contextmenu';

但是,这似乎在 CKEditor 4 中不起作用。

如何在 CKEditor 4 中启用浏览器拼写检查器和上下文菜单?

ckeditor(英语:ckeditor)

评论


答:

1赞 Nate 6/4/2013 #1

我发现使用 CKEditor Builder 并删除 SCAYT 插件,然后将代码放在配置函数中的问题中是有效的。

-2赞 Babu 2/24/2014 #2

请在 config.js 中的工具栏中启用 scayt。如果您使用自定义工具栏渲染编辑器,请确保您已包含“Scayt”。

评论

1赞 Campbeln 2/5/2015
Scayt != 浏览器拼写检查器
6赞 Sergey Ponomarev 12/2/2014 #3

发生这种情况是因为其他插件需要插件:contextmenu Plugin "contextmenu" cannot be removed from the plugins list, because it's required by "liststyle" and "tabletools" plugin.

但实际上拼写检查应该可以工作,但由于插件已启用,因此在右键单击拼写错误的单词时必须按住该键才能查看其建议。Context MenuCtrl

请参阅 CKEditor 拼写检查文档

评论

0赞 guettli 9/28/2017
非常感谢您的回答。普通(非极客)用户很容易混淆。我提出了一个改进:ckeditor 的上下文菜单可以提供帮助文本来显示神奇的 ctrl+右键单击解决方案。这是问题所在:github.com/ckeditor/ckeditor-dev/issues/981
0赞 MillerC 9/10/2020
这里还有一个很好的说明 - 插件的删除顺序很重要......我得到了 x 插件所需的类似内容。将 removePlugins 修改为 config.removePlugins = 'scayt,tableselection,tabletools,contextmenu';让我的设置正常工作。
1赞 g1ji 7/7/2015 #4

为了启用浏览器拼写检查器,您应该添加以下配置:

config.removePlugins = 'liststyle,tabletools,scayt,menubutton,contextmenu';
0赞 pd_au 1/8/2020 #5

认为所有有用答案的摘要可能会有所帮助。

永久

// Prevent CKEditor disabling a browser's native spell checking feature
config.disableNativeSpellChecker = false;
    
// Disable CKEditor's SpellCheckAsYouType plugin;
// Disable CKEditor's contextmenu plugin
config.removePlugins = 'scayt,contextmenu';

部分的、暂时的

如果您需要 CKEditor 的插件(用于其他插件),您的用户将需要按住该键以暂时禁用 CKEditor 的插件,并通过浏览器通常的上下文菜单访问浏览器的本机拼写检查功能,对于他们想要调整的每个单词。contextmenuCtrlcontextmenu

// Prevent CKEditor disabling a browser's native spell checking feature
config.disableNativeSpellChecker = false;
    
// Disable CKEditor's SpellCheckAsYouType plugin;
// Disable CKEditor's contextmenu plugin
config.removePlugins = 'scayt';