easy-markdown-editor icon indicating copy to clipboard operation
easy-markdown-editor copied to clipboard

Remote spellcheck server

Open leonardorame opened this issue 3 years ago • 7 comments

Hi, I'm evaluating the replacement of CKEditor to EasyMDE and I wonder how the spell checker works. Is there a way to do the spellchecking server side?, I need this because our system has a central dictionary of medical terms, and it would be awesome to use it from EasyMDE.

leonardorame avatar May 11 '21 12:05 leonardorame

EasyMDE employs sparksuite / codemirror-spell-checker. I've opened a PR to allow for specifying a custom spell checker (#333) which would theoretically allow you to create your own fork that points to a custom dictionary.

smundro avatar May 18 '21 23:05 smundro

@leonardorame

I think #333 will solve your issue, you can use it in the config like this:

const editor = new EasyMDE({
    spellChecker: (editor) => {
        // Call to remote spellcheck server using values from 'editor'.
        // Process the response and edit 'editor' accordingly.
    },
});

You can look at https://github.com/sparksuite/codemirror-spell-checker/blob/master/src/js/spell-checker.js and use snippets to create your own spell checker, or fork/copy that repo and implement your needs into it.

The custom spellchecker functionality is currently available on the easymde@next branch and will be released after a few days if it satisfies the use-cases.

Ionaru avatar May 23 '21 14:05 Ionaru

Hi @Ionaru, thanks for this.

Can I do, for example, this?:

const editor = new EasyMDE({ 
    spellchecker: (editor) => function(options) {
        console.log(options);
    },
})

leonardorame avatar May 26 '21 16:05 leonardorame

Hi @Ionaru, is the #333 included in 2.15.0?

leonardorame avatar May 28 '21 10:05 leonardorame

Sorry, I asked too fast. Where is the easymde@next branch? I cannot reach it from the branches dropdown menu.

leonardorame avatar May 28 '21 10:05 leonardorame

Got it npm i [email protected].

leonardorame avatar May 28 '21 10:05 leonardorame

You can also run npm i easymde@next

Ionaru avatar May 28 '21 13:05 Ionaru