提问人:Nate 提问时间:6/4/2013 更新时间:1/8/2020 访问量:7781
如何在 CKEditor 4 中启用浏览器拼写检查?
How to enable browser spell check in CKEditor 4?
问:
据说 CKEditor 有内置的拼写检查,但我从未见过它的工作(甚至在他们的现场演示网站上也没有),所以在 CKEditor 3 中,我在配置函数中添加了以下内容以启用浏览器拼写检查并启用浏览器上下文菜单:
config.disableNativeSpellChecker = false;
config.removePlugins = 'scayt,menubutton,contextmenu';
但是,这似乎在 CKEditor 4 中不起作用。
如何在 CKEditor 4 中启用浏览器拼写检查器和上下文菜单?
答:
我发现使用 CKEditor Builder 并删除 SCAYT 插件,然后将代码放在配置函数中的问题中是有效的。
请在 config.js 中的工具栏中启用 scayt。如果您使用自定义工具栏渲染编辑器,请确保您已包含“Scayt”。
评论
发生这种情况是因为其他插件需要插件:contextmenu
Plugin "contextmenu" cannot be removed from the plugins list, because it's required by "liststyle" and "tabletools" plugin.
但实际上拼写检查应该可以工作,但由于插件已启用,因此在右键单击拼写错误的单词时必须按住该键才能查看其建议。Context Menu
Ctrl
请参阅 CKEditor 拼写检查文档
评论
为了启用浏览器拼写检查器,您应该添加以下配置:
config.removePlugins = 'liststyle,tabletools,scayt,menubutton,contextmenu';
认为所有有用答案的摘要可能会有所帮助。
永久
// 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 的插件,并通过浏览器通常的上下文菜单访问浏览器的本机拼写检查功能,对于他们想要调整的每个单词。contextmenu
Ctrl
contextmenu
// 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';
评论