Spellcheck is not working in Chrome

2.2k views Asked by At

I'm trying to use this markdown editor https://simplemde.com/, but in Chrome (other browsers as well) auto spell check is not working inside the editor area.

I have tried to add spell check and content editable inside and elements (which is used for edit), but it is still not working.

Does anybody know, how to enable spell check in this case?

I know that guys have their own spell checker instrument, but it supports only English language.

2

There are 2 answers

0
guar47 On

I found the place where guys switch off the spellchecker and comment this. It helps. https://github.com/sparksuite/simplemde-markdown-editor/issues/630 Thanks for your answers.

4
ByWaleed On

According to the Github Page, there is a spell checking property called spellChecker which is by default set to true. You can try manually setting it to true for your code ( provide code so I might be able to give a direct answer to your problem ).

Example shown on github:

// Most options demonstrate the non-default behavior
var simplemde = new SimpleMDE({
    autofocus: true,
    autosave: {
        enabled: true,
        uniqueId: "MyUniqueID",
        delay: 1000,
    },
    blockStyles: {
        bold: "__",
        italic: "_"
    },
    element: document.getElementById("MyID"),
    forceSync: true,
    hideIcons: ["guide", "heading"],
    indentWithTabs: false,
    initialValue: "Hello world!",
    insertTexts: {
        horizontalRule: ["", "\n\n-----\n\n"],
        image: ["![](http://", ")"],
        link: ["[", "](http://)"],
        table: ["", "\n\n| Column 1 | Column 2 | Column 3 |\n| -------- | -------- | -------- |\n| Text     | Text      | Text     |\n\n"],
    },
    lineWrapping: false,
    parsingConfig: {
        allowAtxHeaderWithoutSpace: true,
        strikethrough: false,
        underscoresBreakWords: true,
    },
    placeholder: "Type here...",
    previewRender: function(plainText) {
        return customMarkdownParser(plainText); // Returns HTML from a custom parser
    },
    previewRender: function(plainText, preview) { // Async method
        setTimeout(function(){
            preview.innerHTML = customMarkdownParser(plainText);
        }, 250);

        return "Loading...";
    },
    promptURLs: true,
    renderingConfig: {
        singleLineBreaks: false,
        codeSyntaxHighlighting: true,
    },
    shortcuts: {
        drawTable: "Cmd-Alt-T"
    },
    showIcons: ["code", "table"],
    spellChecker: false,
    status: false,
    status: ["autosave", "lines", "words", "cursor"], // Optional usage
    status: ["autosave", "lines", "words", "cursor", {
        className: "keystrokes",
        defaultValue: function(el) {
            this.keystrokes = 0;
            el.innerHTML = "0 Keystrokes";
        },
        onUpdate: function(el) {
            el.innerHTML = ++this.keystrokes + " Keystrokes";
        }
    }], // Another optional usage, with a custom status bar item that counts keystrokes
    styleSelectedText: false,
    tabSize: 4,
    toolbar: false,
    toolbarTips: false,
});

This is what is happening here: spellChecker: false,. So try setting it to true, like shown in this example to your case.