What is the current state of spellcheck?

As I can see spellchecking is not working for all demos :frowning:

See issue-390.

wes-r: Sounds like due to the way ProseMirror works this is sort of a WONTFIX/CANTFIX and there’s now an option to disable default spell check.

I ended up having to make a custom spell checker. Despite already having done that, I’d still much prefer ProseMirror to be able to use the default OS spell checker.

Here is a case that breaks chrome’s spell checking - type a line of garbage words, then go to the middle of it and press Enter (split it), the first/top part of it will not be spell checked :frowning:

wes-r, any chance of sharing your custom spell checker ?

Sorry I cannot (closed source). I also don’t have it 100% yet (may have issues with decorators and links).

My Approach:

  • Write a plugin to handle it all
  • Process document in your apply() method
  • Scan document for unique words
  • Check spelling of each word
  • Apply a decorator to show the word as misspelled

This will be a fairly decent undertaking!

ok thx, I have already written a spellchecker for CodeMirror (gist) I’ll look at converting it to PM at some point.

One thing to keep in mind is plugins have a handleContextMenu which is what I use to determine if the user “right” clicks on a misspelled word and then I pop open my suggestion box.

Yes thx, what’s more challenging is that PM doesn’t have the concept of overlays like cordemirror has …

or perhaps Marijn can comment on the case I noted above breaking chrome spellchecker ?

(type a line of garbage words, then go to the middle of it and press Enter (split it), the first/top part of it will not be spell checked)

An other way is to be patient and wait for native browsers implementations : https://html.spec.whatwg.org/multipage/interaction.html#dom-forcespellcheck

yes but that will mean spellchecking the entire editor on every edit :frowning:

Browser spell check wasn’t designed with intelligent editor implementations which do their own DOM updates in mind, and as such most of the time, when ProseMirror steps in to apply some document change, it will reset the browser spell check state. This is unfortunate, but not something we can fix.

yes, there is a real need for a separate prosemirror spellcheck solution.

(‘unfortunte’ is very understated … considering they already have the whole spellchecking there and they only make it work sometimes, if you’re lucky … lame)

forcespellcheck() is defined on Element. If you manually update a small span in your (big) editor and call mySpan.forcespellcheck(), I think only the content of this span will be (re)spellchecked.

yes :slight_smile: guess you’re right