sparksuite / codemirror-spell-checker Goto Github PK
View Code? Open in Web Editor NEWDead-simple spell checking in CodeMirror
Home Page: http://sparksuite.github.io/codemirror-spell-checker/
License: MIT License
Dead-simple spell checking in CodeMirror
Home Page: http://sparksuite.github.io/codemirror-spell-checker/
License: MIT License
Currently the digits 0 through 9 do not show as errors, but anything 10 or higher does. Either number highlighting as errors should show according to the rules for writing numbers ( http://www.grammarbook.com/numbers/numbers.asp ), or they shouldn't be highlighted at all.
This is what I have in <head>
:
<script src="https://cdn.jsdelivr.net/npm/[email protected]/src/js/spell-checker.min.js" type="text/javascript"></script>
<script src="https://codemirror.net/addon/mode/overlay.js" type="text/javascript"></script>
This fails with error ReferenceError: require is not defined
due to an attempt to require typo-js
. What I understand is that require
will work within Node.js runtime but not in browser. What's the solution?
typo.js
has a suggest
function, but it seems there's not a way for a user to invoke it and get suggestions for their misspelled words.
when loading an initial text into CM with cm.setValue(), how can I run the spellchecker on it ?
thx!
Be sure to load/require overlay.min.js if you haven't already.
What is this? Where do I find it?
Or alternately, is there a way I can use your simplemde editor (which I use in one part of my project) to just do the spellchecking and nothing else in another part of my project? That'd be nice, since I then only have to load the one library, and simplemde seems to have everything out of the box.
This library is declared as a dependency by 'simplemde-markdown-editor', which is CommonJS compatible, except when it isn't, because src/js/spell-checker.js assumes there is a CodeMirror global, and that breaks the package 'simplemde-markdown-editor'.
I was going to make a fork, then a pull request later, but this guy @universome , has already fixed it...
It would be nice if one could spell check different languages...
I created it for my Markdown editor project.
You can consider to use it too.
The URL is https://spellcheck-dictionaries.github.io/
readme is missing the need to include overlay.min.js
Currently it is hardcoded to use gfm as the only mode option for code mirror. It would be nice to allow for markdown as well as gfm. I was able to almost get it working by using:
var simple = new SimpleMDE(options);
var cm = simple.codemirror;
cm.setOption("mode", "markdown");
but this ruins spell checking. I also tried setting the mode to "spell-checker" with "backdrop" option set to "markdown" using the same method as above, but this did not work.
Using the French dic and aff files from https://github.com/titoBouzout/Dictionaries/tree/master, I noticed that a lot of very common words are shown as misspelled. Example: "je".
In the dic file, this is the line defining the word:
je po:mg po:propersuj po:1pe is:epi is:sg
All the other words without a "/" character behaved the same.
A quick regexp search and replace to add "/" solved the issue, but I was wondering whether that was actually the intended behavior.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.