Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support ignoring code blocks in GFM #36

Open
wants to merge 47 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
aa6bcba
Support ignoring code blocks in GFM
craftzdog Sep 30, 2017
29285be
Advance stream
craftzdog Sep 30, 2017
7237e68
Added multilanguage support
eutampieri Nov 14, 2017
a39f649
Fixed syntax error
eutampieri Nov 14, 2017
84f28cd
Fix bad variable.
queenvictoria Jan 20, 2018
9b08b1b
Merge pull request #2 from johnf/doc
craftzdog Jul 21, 2018
b836d8b
refactor(*): Simplify codebase
craftzdog Jul 19, 2019
47d0f01
fix(*): Make it work
craftzdog Jul 19, 2019
3b7ca99
feat(dic): Add some languages
craftzdog Jul 19, 2019
b3192d5
fix(js): Remove default language
craftzdog Jul 19, 2019
0cc82ca
docs(readme): Add a note about other language
craftzdog Jul 19, 2019
e659739
chore(scripts): Add scripts for publishing
craftzdog Jul 20, 2019
e05413d
fix(mode): Ignore non-ascii chars
craftzdog Jul 20, 2019
045f220
1.0.1
craftzdog Jul 20, 2019
eaca04a
fix(overlay): ignore url and string
craftzdog Jan 10, 2020
4024ae5
1.0.2
craftzdog Jan 10, 2020
f030ef7
chore(stack): update deps
craftzdog Apr 6, 2020
2b7ac61
fix(overlay): do not break non-word tokens
craftzdog Apr 6, 2020
84c9411
1.0.3
craftzdog Apr 6, 2020
99311d9
chore(eslint): cleanup prettier warnings
craftzdog Apr 6, 2020
0a37c67
fix(dictionary): fix base dic url
craftzdog Apr 6, 2020
5a12be9
chore(dep): dev stack
craftzdog Mar 12, 2021
6a67a74
chore(dep): update deps
craftzdog Mar 12, 2021
e64a8a6
fix(tokenizer): misspellings placed after hyperlinks are not indicated
craftzdog Mar 12, 2021
f9da778
1.0.4
craftzdog Mar 12, 2021
a5dec43
feat(dic): Add Russian language
Nov 22, 2021
e317932
feat(dic): Add Russian language
Nov 22, 2021
e252b3b
fix: revert package-lock.json changes
Nov 22, 2021
c518f71
Merge pull request #4 from perehodit/master
craftzdog Nov 26, 2021
22f5d56
chore(dev): update toolset
craftzdog Nov 26, 2021
69b7f7d
chore(dep): bump up dependencies
craftzdog Nov 26, 2021
c5711f5
1.1.0
craftzdog Nov 26, 2021
a56543a
chore(babel): update config
craftzdog Nov 27, 2021
386e344
fix(fetch): use v2
craftzdog Nov 27, 2021
f3e530d
1.1.1
craftzdog Nov 27, 2021
91ab2a1
feat(dictionary): add Spanish
craftzdog Aug 31, 2022
323450a
chore(dep): bump up
craftzdog Aug 31, 2022
eb68715
chore(dev): bump up deps
craftzdog Aug 31, 2022
0a77af0
1.1.2
craftzdog Aug 31, 2022
28a9108
fix(data): convert from latin1 to utf-8
craftzdog Aug 31, 2022
b1c971f
1.1.3
craftzdog Aug 31, 2022
a5b811d
fix(token): check word length
craftzdog Nov 21, 2022
99122cf
build(*): compile
craftzdog Nov 21, 2022
9098c21
1.1.4
craftzdog Nov 21, 2022
05be51a
add Ukrainian language
velzepooz Nov 29, 2022
0838183
Merge pull request #7 from velzepooz/master
craftzdog Nov 30, 2022
d781d57
1.2.0
craftzdog Nov 30, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"presets": [
["@babel/preset-env", {
"targets": { "electron": "12.2.1" }
}]
],
"plugins": [
"@babel/plugin-proposal-class-properties"
]
}
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/spell-checker.js
23 changes: 0 additions & 23 deletions .eslintrc

This file was deleted.

14 changes: 14 additions & 0 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
root: true
extends:
- prettier
parser: "@babel/eslint-parser"
env: {}
globals: {}
rules:
no-useless-escape: 0
prefer-const: 2
no-unused-vars:
- 2
-
argsIgnorePattern: ^_
varsIgnorePattern: ^_
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
localtesting/*
*.map
node_modules/
18 changes: 0 additions & 18 deletions .travis.yml

This file was deleted.

1 change: 1 addition & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
The MIT License (MIT)

Copyright (c) 2015 Wes Cossick
Copyright (c) 2019 Takuya Matsuyama

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
46 changes: 28 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,45 +1,55 @@
# 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.

Inspired by fantastic work done by [Wes Cossick](https://github.com/sparksuite/codemirror-spell-checker).

[Demo](http://nextstepwebs.github.io/codemirror-spell-checker/)

![Screenshot](http://i.imgur.com/7yb5Nne.png)

It works only on Electron apps since it depends on NodeJS.

## Install

Via [npm](https://www.npmjs.com/package/codemirror-spell-checker).
```
npm install codemirror-spell-checker --save
```
Via [npm](https://www.npmjs.com/package/@inkdropapp/codemirror-spell-checker).

Via [bower](https://www.bower.io).
```
bower install codemirror-spell-checker --save
```

Via [jsDelivr](https://www.jsdelivr.com/projects/codemirror.spell-checker). *Please note, jsDelivr may take a few days to update to the latest release.*

```HTML
<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>
npm install @inkdropapp/codemirror-spell-checker --save
```

## 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.

```JS
CodeMirrorSpellChecker({
codeMirrorInstance: CodeMirror,
});
import SpellChecker from '@inkdropapp/codemirror-spell-checker'

SpellChecker(CodeMirror)

CodeMirror.fromTextArea(document.getElementById("textarea"), {
mode: "spell-checker",
backdrop: "gfm" // Your desired mode
mode: "spell-checker",
backdrop: "gfm", // Your desired mode
spellCheckLang: "en_US"
});
```

That's it!

## Other languages

Some languages are tested and bundled in [the data directory](/inkdropapp/codemirror-spell-checker/tree/master/data).
It supports other languages by downloading the dictionary files from [titoBouzout/Dictionaries](https://github.com/titoBouzout/Dictionaries).
In order to use another language instead of `en_US` you just have to provide a language name listed in the above repository like so:

```JS
CodeMirror.fromTextArea(document.getElementById("textarea"), {
mode: "spell-checker",
backdrop: "gfm",
spellCheckLang: "en_AU"
});
```

## Customizing
You can customize the misspelled word appearance by updating the CSS. All misspelled words will have the `.cm-spell-error` class.

Expand Down
27 changes: 0 additions & 27 deletions bower.json

This file was deleted.

Loading