Spell Checker adds spell checking as-you-type capabilities to {productname}. For information on the supported languages, refer to this section.
To enable the {productname} Enterprise Spellchecking plugin with {cloudname}, add tinymcespellchecker to the plugins list.
With {cloudname} the server-side spellchecking component is automatically configured, so the spellchecker_rpc_url parameter does not need to be set.
To enable the {productname} Enterprise Spellchecking plugin, add tinymcespellchecker to the plugins list.
For information on installing the server-side component for spell checking, please see the Deploy the {productname} spelling service server-side component using Docker.
The {productname} Enterprise Spellchecking plugin activates automatically when users type content into the editor. To select a spelling suggestion for a misspelled word, right-click the misspelled word to open the contextual menu.
The Spell Checker plugin provides the following commands.
This event triggers when the user selects Ignore on a misspelled word.
This event triggers when the user selects Ignore All on a misspelled word.
This event triggers when the user enables the spellchecker.
This event triggers when the user disables the spellchecker.
This event triggers when a spellchecker error occurs, such as the Spell Checker service can’t be reached.
This event fires when the spellchecking language is changed.
tinymce.init({
selector: 'textarea',
plugins: 'tinymcespellchecker',
toolbar: 'spellchecker',
init_instance_callback: (editor) => {
editor.on('SpellcheckerLanguageChanged', (e) => {
console.log(`Spelling language changed: ${e.language}. Previous language: ${e.prevLanguage}`);
});
}
});This event is fired when the editor content is checked for misspellings and suggestions, either by opening the Spell Checker dialog, or by executing the mceSpellcheckUpdate command.
|
Note
|
This event is not fired when Spell Checker is operating in As-You-Type mode. |
tinymce.init({
selector: 'textarea',
plugins: 'tinymcespellchecker',
toolbar: 'spellchecker',
init_instance_callback: (editor) => {
editor.on('SpellcheckerUpdated', (e) => {
const spelling = e.spelling;
for (const [ language, words ] of Object.entries(spelling)) {
for (const [ word, suggestions ] of Object.entries(words)) {
console.log(`${language} suggestions for ${word}:`, suggestions);
}
}
});
}
});The spelling object, which is provided by the SpellcheckerUpdated event, contains the result of the spelling service spellcheck.
The keys of the outermost object are the language code for each checked language (using RFC5646 format, e.g., 'en-US', 'es-ES').
Under each returned language code is an object with
-
keys representing misspelled words; and
-
arrays of values that are possible correct spellings.
spelling: {
en: {
riddiculed: [ 'ridiculed', 'ridicule' ],
impossable: [ 'impossible', 'impassable', 'impassible' ]
},
es: {
impossible: [ 'impasible', 'imposible', 'imposibles', 'imposibilite' ],
designate: [ 'desnate', 'designativo', 'designa-te', 'designare' ],
moment: [ 'momento', 'momentito', 'omento', 'memento' ]
}
}The Spell Checker plugin provides the following APIs.