Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@edemaine/codemirror-spell-checker

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@edemaine/codemirror-spell-checker

Tweaked spell checker for CodeMirror

  • 0.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

CodeMirror Spell Checker

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.

Fork

This is a fork of sparksuite's codemirror-spell-checker.

Added fixes:

Screenshot

Install

Via npm.

npm install @edemaine/codemirror-spell-checker --save

Via bower.

bower install @edemaine/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/npm/@edemaine/codemirror-spell-checker/latest/spell-checker.min.css">
<script src="https://cdn.jsdelivr.net/npm/@edemaine/codemirror-spell-checker/latest/spell-checker.min.js"></script>

Quick start

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!

Customizing

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 */
}

Configuration

  • customWords: Custom array of words that will not be designated as misspelled. Defaults to an empty array.
// Most options demonstrate the non-default behavior
CodeMirrorSpellChecker({
	codeMirrorInstance: CodeMirror,
	customWords: ["CodeMirror", "GitHub"],
});

Keywords

FAQs

Package last updated on 12 Aug 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc