pirtleshell/codemirror-typo

false positive for the first word of every newline

Closed this issue · 1 comments

image

For the very first word in every new line i am getting a false positive. it does get resolved if i start the line with a space. Can you tell me the reason for this behaviour and how i can resolve it.

my current config of codeMirrorTypo object is:

`
let codeMirrorTypoOptions = {
dictPath: 'https://raw.githubusercontent.com/titoBouzout/Dictionaries/master/',
dictFolder: '',

  filename: 'English (American)',                             
  typoClass: 'typo',                         
                                            
  typoCSS: 'border-bottom: 1px dotted red;',  
  gutterClass: 'test2',                 
  gutterMarkClass: 'test2',              
}

codeMirrorTypo(this.codeMirror, 'English (American)', codeMirrorTypoOptions);

`

Sorry for the delay, did you get this to work?

I haven't been actively maintaining this repo, because I've found that on newer browsers there is a faster solution that makes use of the built-in spellcheck on the browser.

I'd have to double check the specifics, but I recall it being as simple as instantiating your CodeMirror instance with these options:

{
  spellcheck: true,
  inputStyle: 'contenteditable'
}

It puts contenteditable on the line divs, so the browser knows to spellcheck them.