voidlabs / mosaico

Mosaico - Responsive Email Template Editor
https://mosaico.io
GNU General Public License v3.0
1.71k stars 504 forks source link

Spellchecking #239

Closed huelsemann closed 7 years ago

huelsemann commented 7 years ago

I would like to enable browser-based spell checking when editing text content. I have noticed that the spellcheck attribute is set to false and that - once I set it to true manually - spell checking will work.

Would it be possible to enable this for all text blocks by default and if yes, what needs to be changed?

spellcheck

Thanks in advance!

bago commented 7 years ago

I think this depends on tinymce initialization options... try creating a plugin and passing it to the mosaico startup options:

var plugin = function(vm) {
  ko.bindingHandlers.wysiwyg.fullOptions['browser_spellcheck'] = true;
}

https://github.com/voidlabs/mosaico/wiki/Mosaico-Plugins

Please report back if it works.

bago commented 7 years ago

Any news? Did it work? How?

huelsemann commented 7 years ago

Sorry for the late response but I was on holiday and my colleagues didn't find the time to look into this.

Unfortunately it does not work with the plugin - however, it does make a difference as the spellcheck attribute is gone completely when the plugin is defined:

With plugin: image

Without plugin: image

I also tried setting this in wyswig.js as described in #247 with the same effect (spellcheck attribute is gone).

If you have any further ideas please let me know.

Thank you!

bago commented 7 years ago

I guess this is a tinymce issue more than a mosaico issue: if you find a way to make tinymce 4 in "inline mode" to support spellchecking then I can help porting that method to mosaico.

huelsemann commented 7 years ago

I finally managed to get the spellcheck working. The trick was to set this in in the standardOptions in wysiwygs.js instead of the fullOptions, which did not work.

So, in order to enable browser spellchecking, either use a plugin like this (using standardOptions instead of fullOptions in your suggestion):

var plugin = function(vm) { ko.bindingHandlers.wysiwyg.standardOptions['browser_spellcheck'] = true; }

or - similar to #247# - change line 171 in wysiwygs.js from standardOptions: {}, to standardOptions: { browser_spellcheck : "true" },