lhl 6ff0e96ad3 8-4-1 | há 1 ano atrás | |
---|---|---|
.. | ||
debug | há 1 ano atrás | |
dist | há 1 ano atrás | |
src | há 1 ano atrás | |
.eslintrc | há 1 ano atrás | |
.npmignore | há 1 ano atrás | |
.travis.yml | há 1 ano atrás | |
CONTRIBUTING.md | há 1 ano atrás | |
LICENSE | há 1 ano atrás | |
README.md | há 1 ano atrás | |
bower.json | há 1 ano atrás | |
gulpfile.js | há 1 ano atrás | |
package.json | há 1 ano atrás |
Spell checking so simple, you can set up in 60 seconds. It will highlight any misspelled words in light red. Works great in conjunction with other CodeMirror modes, like GitHub Flavored Markdown.
Via npm.
npm install codemirror-spell-checker --save
Via bower.
bower install codemirror-spell-checker --save
Via jsDelivr. Please note, jsDelivr may take a few days to update to the latest release.
<link rel="stylesheet" href="https://cdn.jsdelivr.net/codemirror.spell-checker/latest/spell-checker.min.css">
<script src="https://cdn.jsdelivr.net/codemirror.spell-checker/latest/spell-checker.min.js"></script>
Once CodeMirror is installed and loaded, first provide CodeMirror Spell Checker with the correct CodeMirror function. Then, just set the primary mode to "spell-checker"
and the backdrop mode to your desired mode. Be sure to load/require overlay.min.js
if you haven't already.
CodeMirrorSpellChecker({
codeMirrorInstance: CodeMirror,
});
CodeMirror.fromTextArea(document.getElementById("textarea"), {
mode: "spell-checker",
backdrop: "gfm" // Your desired mode
});
That's it!
You can customize the misspelled word appearance by updating the CSS. All misspelled words will have the .cm-spell-error
class.
.CodeMirror .cm-spell-error{
/* Your styling here */
}