First of all, CodeMirror is awesome! We’ve developing a Markdown note-taking app and we’re using CodeMirror for our Markdown source code editor. We’re still in private beta, so haven’t made any money yet, nonetheless we just donated a small amount on PayPal to thank @marijn for your work. It was very to work with CodeMirror.
Onto the crazy-sounding title… I know CodeMirror is supposed to work with highlighting and editing source code, but recently we came across something called HyperMD (GitHub, online demo). It’s basically a WYSIWYG editor in CodeMirror. Inline elements like bold and italics would display their markup upon being edited, and inline HTML will expand to its raw form when interacted. I looked at the code and it looks like it was done through inner modes and attaching lots of DOM event handlers…
For our project, we’re planning to build a WYSIWYG Markdown editor. HyperMD’s approach looks interesting, and if implemented in CodeMirror, we can get some otherwise tricky features for free (multiple carets and vim mode, for example). Our other alternative is to use ProseMirror and extend it ourselves.
My question is, is there some fundamental problem with HyperMD’s approach? For example, I know weird things might happen when the lines have different heights in CodeMirror, and that’s one of our concerns. Is there anything else we should look out for? Is CodeMirror designed with this kind of (crazy) use case in mind at all?