code-farmer-i / vue-markdown-editor

A markdown editor built on Vue
https://code-farmer-i.github.io/vue-markdown-editor/
MIT License
1.07k stars 110 forks source link

Doesn't work with CodeMirrorSpellChecker #246

Closed jj-sg closed 1 year ago

jj-sg commented 1 year ago

Tried to integrate codemirror-spell-checker by passing codemirrorConfig

{
  mode: "spell-checker",
  backdrop: "gfm",
}

The spelling check didn't work. After checking source code, found the code below in codemirror-editor.vue

this.codemirrorInstance = new this.Codemirror(this.$refs.codemirrorEditor, {
      lineNumbers: true,
      styleActiveLine: true,
      autoCloseTags: true,
      matchBrackets: true,
      indentWithTabs: true,
      autoCloseBrackets: true,
      ...this.codemirrorConfig,
      tabSize: this.tabSize,
      indentUnit: this.tabSize,
      value: this.text,
      placeholder: this.placeholder,
      mode: 'markdown',
      lineWrapping: true,
      scrollbarStyle: 'overlay',
    });

spell-checker is overwritten by markdown. Maybe should move ...this.codemirrorConfig to the end