Markdown Editor and Browser Spell Checking
Here is the problem. I needed a minimal and stable Markdown editor for my project LucentCMS. I was already using Codemirror for the code fields, so I though why not use the same library for markdown fields.
The good news is that Codemirror does have a Markdown mode, which is working pretty well in my opinion. The bad news is that is didn't seem to support the browser's native spellchecking.
I decided to start looking for other markdown editors but sadly I couldn't find even one with native spellchecking support, except StackEdit. But, StackEdit was an overkill for my scenario.
Anyway, after some searching I found this thread and it works great. You just have to set the following in your Codemirror config
{
inputStyle: "contenteditable",
spellcheck: true
}
Your only concern would be older browsers.
published at Sat, 14 Aug 2021 14:44In Collections
Coding
Mostly stuff about web development