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

[Feature Request] Add the ability to destruct the editor #818

Closed hsalem7 closed 3 years ago

hsalem7 commented 3 years ago

If there is a place where we are conditionally showing the editor, then it is better to have a destruct method.

var simplemde = new SimpleMDE({ element: document.getElementById("MyID") });

And when there is a need to hide/remove the editor:

simplemde.destruct();

It should remove all the elements that were added because of the construct method.