返回介绍

Check spelling in TinyMCE

发布于 2019-05-06 06:50:24 字数 2424 浏览 1218 评论 0 收藏 0

TinyMCE provides several options to bring spell checking capabilities to your users.

Browser-based spell checking

Assign the browser_spellcheck configuration option the value of true to utilize the browser’s native spell check functionality. Enabling the contextmenu option may be required depending on the right-click or context usability requirement.

tinymce.init({
  selector: 'textarea',  // change this value according to your HTML
  browser_spellcheck: true,
  contextmenu: false
});

PHP Spellchecker component

You can also use TinyMCE’s PHP Spellchecker component, that you can download here. To view the complete changelog history, view this txt file. The TinyMCE’s PHP Spellchecker component requires a little more work than the browser-based option, being a server-side script.

This plugin enables Enchant or PSpell on the server to spell check content within the TinyMCE editor.

Installation steps for the default Enchant engine
  1. Enable Enchant in PHP.
  2. Download the TinyMCE Spellchecker for PHP package. (Direct download).
  3. Unpack the package in the /path/to/tinymce/plugins/spellchecker directory.
  4. Configure TinyMCE to use the spell checker by enabling the spellchecker plugin.
  5. Configure the spellchecker_rpc_url to 'spellchecker.php'.
  6. Download word lists and place them in the /dicts directory for example “es_ES.dic, es_ES.aff”.
Example
tinymce.init({
  selector: 'textarea',  // change this value according to your HTML
  plugins: 'spellchecker',
  toolbar: 'spellchecker',
  spellchecker_rpc_url: 'spellchecker.php'
});

Review the Spell Checker plugin for advanced configuration options.

TinyMCE Spell Checker Pro plugin

Use the Spell Checker Pro plugin for scalable enterprise-grade spell check as-you-type functionality. Spell Checker Pro requires both a client-side plugin to be configured and a server-side component to be installed and configured.

Review the TinyMCE Premium Features documentation for Spelling. Learn more about TinyMCE Premium Products here.

Next Filtering TinyMCE content

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文