easy-markdown-editor
easy-markdown-editor copied to clipboard
Remote spellcheck server
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.
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.
@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.
Hi @Ionaru, thanks for this.
Can I do, for example, this?:
const editor = new EasyMDE({
spellchecker: (editor) => function(options) {
console.log(options);
},
})
Hi @Ionaru, is the #333 included in 2.15.0?
Sorry, I asked too fast. Where is the easymde@next
branch? I cannot reach it from the branches dropdown menu.
Got it npm i [email protected]
.
You can also run npm i easymde@next