sparksuite / simplemde-markdown-editor

A simple, beautiful, and embeddable JavaScript Markdown editor. Delightful editing for beginners and experts alike. Features built-in autosaving and spell checking.
https://simplemde.com
MIT License
9.79k stars 1.12k forks source link

Allow content in the non preview editor to be replaced #761

Open charlesr1971 opened 4 years ago

charlesr1971 commented 4 years ago

It would be great if it was possible to allow content in the non preview editor to be replaced. I want to allow users to add a placeholder like:

{{image1}}

And, then I can use the change handler to analyse the content and if it finds a placeholder, it will swap it for an uploaded image. The images will be uploaded outside the simplemde editor.

What I need is a method that will allow me to insert all of the content back into the editable [non preview] area of the simplemde editor.