Hello and thanks for the distribution :)
Sorry for my bad English

Problem/Motivation

I have a site with a listing where the nodes body gets trimmed. With the time, the length of the trimmed bodies started on some nodes to be too short for what it should be. So I investigated and found that the spell checker that comes with TinyMCE inserts spans like <span class="hiddenSpellError"> that if you don't disable before saving they don't get removed and next time they are not recognized. Better explained here. It is very easy that an editor saves the page without deactivating the spell checker.

Proposed resolution

People have a spell checker in their browser, so it is easy that they use it. You can activate it with


/*** TINYMCE IN-BROWSER SPELLCHECK ***/
function YOUR-THEME/MODULE_wysiwyg_editor_settings_alter(&$settings, $context) {
  if ($context['profile']->editor == 'tinymce') {
   //General for browsers, but Explorer 8 or 9
    $settings['browser_spellcheck'] = TRUE;
    // Firefox and other gecko spell checker
    $settings['gecko_spellcheck'] = TRUE;
  }
}

And deactivate the plugin in admin/config/content/wysiwyg/profile/panopoly_wysiwyg_text

It works with Firefox 57.0.1 (64-bit) and Chromium Version 62.0.3202.89 on different Ubuntu versions (14 and 16)
https://www.tinymce.com/docs/configure/spelling/
For the browsers versions https://tracker.moodle.org/browse/MDL-34674 and also possibility to check browser and activate or deactivate the spell checker.

Remaining tasks

It will be needed to test in other platforms and an explanation on the update. And if the feature is accepted, a patch. Also to disable the plugin in TinyMCE or check the browser.

User interface changes

The spelling button disappears if disabled by checking.

Also, for people finding this problem, I exported the field_data_body table a run a find and replace to delete the spans (there were many <span></span>). I was lucky that my clients don't use it for styling. I also got <span data-offset-key="7q7ba-0-0"><span data-text="true"></span></span> that I am not sure where they come from. To delete the spans I used </?span.*?>

Comments

candelas created an issue.

dsnopek’s picture

Thanks!

I think adding an option to disable the spellchecker makes sense. I don't think we can remove it out right, because the 1.x branch is "stabilized" and we don't want to break anyone who may be using it. We could maybe disable the spellchecker for new installs but that would need a ton of verification on how well the browser spellchecker works on a number of browsers.