-
-
Notifications
You must be signed in to change notification settings - Fork 5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Does not integrate with Chrome's spell check #1017
Comments
This is unavoidable. A CodeMirror instance is, as far as the browser is concerned, not an editable control, so it won't apply spell checking to it. It would not be hard to write a custom spell checker that works on CodeMirror, and there has been talk about doing this, but no one has actually done it yet. Closing this on the grounds of 'that's just the way things are'. |
Just for reference, it looks like someone has integrated typo.js with CodeMirror: http://stackoverflow.com/a/12462720/526741. It could do with some improvements, but it's a start. |
Neat. This is one of the use cases I had in mind when adding the addOverlay On Tue, Jan 22, 2013 at 6:07 PM, Brandon Frohs notifications@git.luolix.topwrote:
|
I came across that stackoverflow link. But realize it only support a limit set of dictionaries. And type.js does NOT support Unicode languages. (Maybe this is the limitation of javascript?) |
CodeMirror documentation indicates that disableSpellcheck:false config option should do the trick, but it does not work. Using the built-in browser spell checking on a text area is a much better way to go than using a javascript library. Then I do not need to train multiple dictionaries and it knows my language regardless of where I am in the world. Seems like it is time to drop CodeMirror for Markdown and look at http://markitup.jaysalvat.com/home/ - sad... since I really like CodeMirror. |
AFACIT |
FYI, I was able to enable spell checking using the HTML5 attribute
Maybe CodeMirror can drop all of these |
Since version 4, each line is wrapped in a |
@marijnh the thread with many details was mentioned above: In short:
|
Okay, yeah, that uses |
Just FYI to anyone following this issue. We did manage to trick the browser by setting contenteditable=true and spellcheck=true. It appears to work on Firefox (will highlight wrong words) and sometimes on Chrome (not always highlight but sometimes it does). But it has a major show stopper problem: when you use browser's spellcheck correction function, i.e. right click on the wrong word and choose the correct word, the value change event is not detected by codemirror. I am using version 3 not sure about version 4. |
👍 |
Perhaps each browser implements their own callback event when a spelling
|
I just noticed that ckeditor seems to work, but probably because its using an iframe with
|
@huangp how exactly did you get it to work with These method have not worked for me:
|
@scottyli See my post #1017 (comment). Which, points to my JS examples over in another comment thread: |
For those still wondering, or for future viewers, I've created a CodeMirror plugin that spell checks as your write. It's super simple to set up. Check it out at: https://github.com/NextStepWebs/codemirror-spell-checker |
👍 |
I created a spellchecker with typo corrections : |
@kofifus would you be interested in submitting a PR with this functionality to https://github.com/NextStepWebs/codemirror-spell-checker? |
Thx Wes, I don't see how a PR will work as basically there is not much common code .. |
@kofifus what is the license for your gist code? If it's not explicitly stated, no one can use your code, just watch it :) |
I created a dictionary files source here: You can use it for typo.js or other spellcheck solutions as well. |
Has someone managed to implement one of the proposed solutions ? |
Code snippet:
In Firefox if browser spell check is enabled then inside the editor words are marked. In Chrome, it doesn't work (maybe not entirely. Sometimes I can trigger one word to be marked but not consistently).
NOTE
I also included a pure content editable div underneath. In Chrome, it won't mark spelling error at page load time. But once focusing on the word or start editing the content, spell check take into effect. So not sure if is this a Chrome thing or CodeMIrror thing.
The text was updated successfully, but these errors were encountered: