Inlining images in markdown editor?

Continuing the discussion from Discourse create new topic user experience on mobile:

One pain point with authoring on mobile in Discourse is that images generate a large amount “techy” markdown when added.

We have stayed away from departing from a textarea for all authoring for very good reason, it is a huge slippery slope.

That said, I am curious.

How feasible would it be to build a plugin that replaces the textarea with a “special” prose mirror component that only does inlining of images into the document and keeps all the rest of markdown in tact?

Meaning markdown is maintained just as is, except that <img> tags are always expanded to visual counterparts after hoisting code blocks.

Sure, ProseMirror could do something like that. Though unless you are planning other potential WYSIWYG-ish features, using CodeMirror is probably easier – as a text editor, that’s by default close to what you’re doing now, with support for replacing part of the text with a DOM widget.