Open lexterror opened 4 years ago
This is possible using custom toolbar actions!
Btw may I suggest https://github.com/Ionaru/easy-markdown-editor, a continuation of SimpleMDE with added features and bugfixes.
For example:
new EasyMDE({
toolbar: [{
name: 'save',
action: function(editor) {
var element = document.createElement('a');
element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(editor.value()));
element.setAttribute('download', 'easymde.md');
element.style.display = 'none';
document.body.appendChild(element);
element.click();
document.body.removeChild(element);
},
className: 'fa fa-save',
title: 'Save markdown'
},
});
I would like to have a save button that would download the markdown file with an "md" extension onto my computer.
Thank you!